diff --git a/src/helma/main/ApplicationManager.java b/src/helma/main/ApplicationManager.java index 4f53c300..ac4ede4f 100644 --- a/src/helma/main/ApplicationManager.java +++ b/src/helma/main/ApplicationManager.java @@ -47,10 +47,9 @@ public class ApplicationManager { try { for (Enumeration e = props.keys(); e.hasMoreElements (); ) { String appName = (String) e.nextElement (); - boolean self = "self".equalsIgnoreCase (props.getProperty (appName)); if (applications.get (appName) == null) { - start (appName, self); - register (appName, self); + start (appName); + register (appName); } } // then stop deleted ones @@ -68,15 +67,16 @@ public class ApplicationManager { } } - void start (String appName, boolean self) { + void start (String appName) { Server.getLogger().log ("Building application "+appName); try { Application app = new Application (appName, hopHome, Server.sysProps, Server.dbProps); applications.put (appName, app); // if we're running with the embedded web server, set app base uri to /appname - if (server.websrv != null && !self) + if (server.websrv != null && !"base".equalsIgnoreCase (appName)) app.setBaseURI ("/"+java.net.URLEncoder.encode (appName)); // check if the root object of the application is the Server itself + boolean self = "self".equalsIgnoreCase (props.getProperty (appName)); if (self) app.setDataRoot (server); // the application is started later in the register method, when it's bound @@ -105,16 +105,15 @@ public class ApplicationManager { applications.remove (appName); } - void register (String appName, boolean self) { + void register (String appName) { try { Server.getLogger().log ("Binding application "+appName); Application app = (Application) applications.get (appName); - // app.start (); if (server.websrv == null) { Naming.rebind ("//:"+port+"/"+appName, app); } else { AcmeServletClient servlet = new AcmeServletClient (app); - if (self) + if ("base".equalsIgnoreCase (appName)) server.websrv.setDefaultServlet (servlet); else { server.websrv.addServlet ("/"+appName+"/", servlet); @@ -131,13 +130,11 @@ public class ApplicationManager { try { for (Enumeration e = props.keys(); e.hasMoreElements (); ) { String appName = (String) e.nextElement (); - boolean self = "self".equalsIgnoreCase (props.getProperty (appName)); - start (appName, self); + start (appName); } for (Enumeration e = props.keys(); e.hasMoreElements (); ) { String appName = (String) e.nextElement (); - boolean self = "self".equalsIgnoreCase (props.getProperty (appName)); - register (appName, self); + register (appName); } if (server.websrv != null) { File staticContent = new File (server.getHopHome(), "static");