Removed the need to register application servlets for the internal web server

with both appname+"/" and appname+"/*", because Acme Serve now appends
dual dummy slashes to the URI path if the servlet for a request isn't found.
This commit is contained in:
hns 2002-03-21 15:49:02 +00:00
parent b68fb4764c
commit c503592c49
2 changed files with 5 additions and 2 deletions

View file

@ -658,6 +658,9 @@ class ServeConnection implements Runnable, HttpServletRequest, HttpServletRespon
if (reqQuery != null)
reqQuery = decode (reqQuery);
Servlet servlet = (Servlet) serve.registry.get( reqUriPath );
// maybe the application name without slash? try with slash appended
if (servlet == null)
servlet = (Servlet) serve.registry.get (reqUriPath+"//");
if (servlet == null)
servlet = serve.defaultServlet;
if ( servlet != null )

View file

@ -94,7 +94,7 @@ public class ApplicationManager {
if (server.websrv == null) {
Naming.unbind ("//:"+port+"/"+appName);
} else {
server.websrv.removeServlet ("/"+appName+"/");
// server.websrv.removeServlet ("/"+appName+"/");
server.websrv.removeServlet ("/"+appName+"/*");
}
app.stop ();
@ -116,7 +116,7 @@ public class ApplicationManager {
if ("base".equalsIgnoreCase (appName))
server.websrv.setDefaultServlet (servlet);
else {
server.websrv.addServlet ("/"+appName+"/", servlet);
// server.websrv.addServlet ("/"+appName+"/", servlet);
server.websrv.addServlet ("/"+appName+"/*", servlet);
}
}