这是 manager 里边的 reload 源码,您慢慢看吧,我看不懂。 /**
* Reload the web application at the specified context path.
*
* @param writer Writer to render to
* @param path Context path of the application to be restarted
*/
protected void reload(PrintWriter writer, String path) { if (debug >= 1)
log("restart: Reloading web application at '" + path + "'"); if ((path == null) || (!path.startsWith("/") && path.equals(""))) {
writer.println(sm.getString("managerServlet.invalidPath",
RequestUtil.filter(path)));
return;
}
String displayPath = path;
if( path.equals("/") )
path = ""; try {
Context context = (Context) host.findChild(path);
if (context == null) {
writer.println(sm.getString
("managerServlet.noContext",
RequestUtil.filter(displayPath)));
return;
}
// It isn't possible for the manager to reload itself
if (context.getPath().equals(this.context.getPath())) {
writer.println(sm.getString("managerServlet.noSelf"));
return;
}
context.reload();
writer.println
(sm.getString("managerServlet.reloaded", displayPath));
} catch (Throwable t) {
log("ManagerServlet.reload[" + displayPath + "]", t);
writer.println(sm.getString("managerServlet.exception",
t.toString()));
} }
* Reload the web application at the specified context path.
*
* @param writer Writer to render to
* @param path Context path of the application to be restarted
*/
protected void reload(PrintWriter writer, String path) { if (debug >= 1)
log("restart: Reloading web application at '" + path + "'"); if ((path == null) || (!path.startsWith("/") && path.equals(""))) {
writer.println(sm.getString("managerServlet.invalidPath",
RequestUtil.filter(path)));
return;
}
String displayPath = path;
if( path.equals("/") )
path = ""; try {
Context context = (Context) host.findChild(path);
if (context == null) {
writer.println(sm.getString
("managerServlet.noContext",
RequestUtil.filter(displayPath)));
return;
}
// It isn't possible for the manager to reload itself
if (context.getPath().equals(this.context.getPath())) {
writer.println(sm.getString("managerServlet.noSelf"));
return;
}
context.reload();
writer.println
(sm.getString("managerServlet.reloaded", displayPath));
} catch (Throwable t) {
log("ManagerServlet.reload[" + displayPath + "]", t);
writer.println(sm.getString("managerServlet.exception",
t.toString()));
} }
解决方案 »
- 用laspe+怎么测试java代码安全漏洞?
- 请问后台怎么强制实现回车事件
- java wav语音文件合成
- j2ee教程 sturts+hibernate +spring 教程下载?
- 新手请问LINUX下Apache+Tomcat实现集群及负载均衡的问题
- struts1的一个传值问题
- 软件应用的设计应该由对象模型来驱动还是应该由数据库模型来驱动?
- Cmp Bmp如何取舍
- 进来看一下,我能这样写吗?30秒就行!
- 根据经纬度定位省份(直辖市)、地市
- 关于网站的数据挖掘
- 求助:spring+webwork+ibatis框架的搭建,项目经理要我搭建1周完成,小妹没什么经验,师哥师姐们能给点相关的经验和文档,小妹万分感谢
reload
public void reload()Reload this web application, if reloading is supported.
IMPLEMENTATION NOTE: This method is designed to deal with reloads required by changes to classes in the underlying repositories of our class loader. It does not handle changes to the web application deployment descriptor. If that has occurred, you should stop this Context and create (and start) a new Context instance instead.
Specified by:
reload in interface Context
Throws:
java.lang.IllegalStateException - if the reloadable property is set to false.