You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by jf...@apache.org on 2003/02/19 21:05:33 UTC
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core ApplicationDispatcher.java
jfarcand 2003/02/19 12:05:33
Modified: catalina/src/share/org/apache/catalina/core
ApplicationDispatcher.java
Log:
Fix bug introduced by myself. The forward information must be based on the original request, not on the forwarded one. Thanks to Jan for pointing the problem.
Revision Changes Path
1.11 +16 -18 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java
Index: ApplicationDispatcher.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ApplicationDispatcher.java 18 Feb 2003 23:49:45 -0000 1.10
+++ ApplicationDispatcher.java 19 Feb 2003 20:05:33 -0000 1.11
@@ -365,6 +365,7 @@
private void doForward(ServletRequest request, ServletResponse response)
throws ServletException, IOException
{
+
// Reset any output that has been buffered, but keep headers/cookies
if (response.isCommitted()) {
if ( log.isDebugEnabled() )
@@ -451,21 +452,18 @@
wrequest.setServletPath(servletPath);
wrequest.setPathInfo(pathInfo);
- if (sb.length() > 0)
- wrequest.setAttribute(Globals.FORWARD_REQUEST_URI_ATTR,
- sb.toString());
- if (contextPath != null)
- wrequest.setAttribute(Globals.FORWARD_CONTEXT_PATH_ATTR,
- contextPath);
- if (servletPath != null)
- wrequest.setAttribute(Globals.FORWARD_SERVLET_PATH_ATTR,
- servletPath);
- if (pathInfo != null)
- wrequest.setAttribute(Globals.FORWARD_PATH_INFO_ATTR,
- pathInfo);
+ wrequest.setAttribute(Globals.FORWARD_REQUEST_URI_ATTR,
+ hrequest.getRequestURI());
+ wrequest.setAttribute(Globals.FORWARD_CONTEXT_PATH_ATTR,
+ hrequest.getContextPath());
+ wrequest.setAttribute(Globals.FORWARD_SERVLET_PATH_ATTR,
+ hrequest.getServletPath());
+ wrequest.setAttribute(Globals.FORWARD_PATH_INFO_ATTR,
+ hrequest.getPathInfo());
+ wrequest.setAttribute(Globals.FORWARD_QUERY_STRING_ATTR,
+ hrequest.getQueryString());
+
if (queryString != null) {
- wrequest.setAttribute(Globals.FORWARD_QUERY_STRING_ATTR,
- queryString);
wrequest.setQueryString(queryString);
wrequest.setQueryParams(queryString);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org