tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 43668] New: - ApplicationDispatcher.doForward for non-HTTP request is always NULL
Date Sun, 21 Oct 2007 20:16:07 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43668>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43668

           Summary: ApplicationDispatcher.doForward for non-HTTP request is
                    always NULL
           Product: Tomcat 6
           Version: 6.0.14
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: mailmur@yahoo.com


This applies to both 6.x and 5.5x version !!

Tomcat6.x
http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java

Tomcat5.5.x
http://svn.apache.org/repos/asf/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java

There is a severe always-NULL case in both T6.x and T5.5x sources if request is
non-HTTP forward. processRequest(req, res, state) method should use the original
"request" and "response" objects, but it gives "hrequest" and "hresponse" objects.

private void doForward(ServletRequest request, ServletResponse response) {
   ...continue...
  // Identify the HTTP-specific request and response objects (if any)
  HttpServletRequest hrequest = null;
  if (request instanceof HttpServletRequest)
     hrequest = (HttpServletRequest) request;
  HttpServletResponse hresponse = null;
  if (response instanceof HttpServletResponse)
     hresponse = (HttpServletResponse) response;

   // Handle a non-HTTP forward by passing the existing request/response
   if ((hrequest == null) || (hresponse == null)) {
      processRequest(hrequest,hresponse,state);
   }
   ...continue...
}

Calling program gets a NPE exception when forwarding a request.
java.lang.NullPointerException at 
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message