remove default servlet if application base is stopped.
This commit is contained in:
parent
43cba33077
commit
f1a304f122
1 changed files with 13 additions and 1 deletions
|
@ -30,6 +30,7 @@ public class ApplicationManager {
|
||||||
private SystemProperties props;
|
private SystemProperties props;
|
||||||
private Server server;
|
private Server server;
|
||||||
private long lastModified;
|
private long lastModified;
|
||||||
|
// EmbeddedTomcat tomcat;
|
||||||
|
|
||||||
public ApplicationManager (int port, File hopHome, SystemProperties props, Server server) {
|
public ApplicationManager (int port, File hopHome, SystemProperties props, Server server) {
|
||||||
this.port = port;
|
this.port = port;
|
||||||
|
@ -38,6 +39,13 @@ public class ApplicationManager {
|
||||||
this.server = server;
|
this.server = server;
|
||||||
applications = new Hashtable ();
|
applications = new Hashtable ();
|
||||||
lastModified = 0;
|
lastModified = 0;
|
||||||
|
/* tomcat = new EmbeddedTomcat();
|
||||||
|
tomcat.setPath("/Users/hannes/Desktop/jakarta-tomcat-4.0.3/test");
|
||||||
|
try {
|
||||||
|
tomcat.startTomcat();
|
||||||
|
} catch (Exception x) {
|
||||||
|
System.err.println ("Error starting Tomcat: "+x);
|
||||||
|
} */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,6 +99,9 @@ public class ApplicationManager {
|
||||||
Naming.unbind ("//:"+port+"/"+appName);
|
Naming.unbind ("//:"+port+"/"+appName);
|
||||||
} else {
|
} else {
|
||||||
// server.websrv.removeServlet ("/"+appName+"/");
|
// server.websrv.removeServlet ("/"+appName+"/");
|
||||||
|
if ("base".equalsIgnoreCase (appName))
|
||||||
|
server.websrv.removeDefaultServlet ();
|
||||||
|
else
|
||||||
server.websrv.removeServlet ("/"+appName+"/*");
|
server.websrv.removeServlet ("/"+appName+"/*");
|
||||||
}
|
}
|
||||||
app.stop ();
|
app.stop ();
|
||||||
|
@ -115,6 +126,7 @@ public class ApplicationManager {
|
||||||
else {
|
else {
|
||||||
server.websrv.addServlet ("/"+appName+"/*", servlet);
|
server.websrv.addServlet ("/"+appName+"/*", servlet);
|
||||||
}
|
}
|
||||||
|
// tomcat.addApplication (appName);
|
||||||
}
|
}
|
||||||
app.start ();
|
app.start ();
|
||||||
} catch (Exception x) {
|
} catch (Exception x) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue