I'd like to suggest that catalina perform a forward, rather than a
redirect, for requests that end with '/'. With a redirect, special
configuration is necessary for proxy servers to work correctly. Also, a
forward doesn't require an additional round trip to the client--a
redirect must get back to the client and the client then issues a new
request. I've tested this under Linux. Thanks!

Matt


--- DefaultServlet.java 2003-01-03 16:20:23.000000000 -0700
+++ DefaultServlet.java.new     2003-01-03 16:20:18.000000000 -0700
@@ -942,26 +942,18 @@
 
             if (!request.getRequestURI().endsWith("/")) {
                 String redirectPath = path;
-                String contextPath = request.getContextPath();
-                if ((contextPath != null) && (!contextPath.equals("/"))) {
-                    redirectPath = contextPath + redirectPath;
-                }
                 if (!(redirectPath.endsWith("/")))
                     redirectPath = redirectPath + "/";
                 redirectPath = appendParameters(request, redirectPath);
-                response.sendRedirect(redirectPath);
+                request.getRequestDispatcher(redirectPath).forward(request, response);
                 return;
             }
 
             ResourceInfo welcomeFileInfo = checkWelcomeFiles(path, resources);
             if (welcomeFileInfo != null) {
                 String redirectPath = welcomeFileInfo.path;
-                String contextPath = request.getContextPath();
-                if ((contextPath != null) && (!contextPath.equals("/"))) {
-                    redirectPath = contextPath + redirectPath;
-                }
                 redirectPath = appendParameters(request, redirectPath);
-                response.sendRedirect(redirectPath);
+                request.getRequestDispatcher(redirectPath).forward(request, response);
                 return;
             }




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to