Often run into the operating department to clear the cache, and the cache has always been a problem, the old in front of the computer is not a way to think of a method, by accessing a JSP page automatically clear cache
<%@ page language= "java" import= "java.io.*" pageencoding= "UTF-8"%>
<%
String path = Request.getcontextpath ();
String basepath = request.getscheme () + "://"
+ request.getservername () + ":" + request.getserverport ()
+ path + "/";
%>
<title>shell</title>
<body>
<%
String Cmds = "monitor.sh";
try {
Process process;
Process = Runtime.getruntime (). EXEC ("sh/opt/wzx/monitor.sh");
InputStreamReader ir = new InputStreamReader (process
. getInputStream ());
LineNumberReader input = new LineNumberReader (IR);
String Line;
Process.waitfor ();
while (line = Input.readline ())!= null) {
Out.print (line);
Out.print ("<br/>");
}
if (input!=null) {
Input.close ();
}
catch (Exception e) {
E.printstacktrace ();
}
%>
</body>
test.sh Script Content
echo ' Flush_all ' | NC 192.168.10.73 11211
Put the script under jboss/server/default/deploy/jboss-web.deployer/root.war/to access the