Summary: | non-HTTP forward will alway result NullPointerException | ||
---|---|---|---|
Product: | Tomcat 5 | Reporter: | Henry Wong <henryxwong> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P4 | ||
Version: | 5.5.17 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | other |
Description
Henry Wong
2006-06-20 15:41:19 UTC
Good question -- ask on the dev list maybe. But also another question: why are you extending HttpServlet and using its method-sensing ability (GET in this case) if your servlet is not HTTP? (In reply to comment #1) > Good question -- ask on the dev list maybe. > > But also another question: why are you extending HttpServlet and using its > method-sensing ability (GET in this case) if your servlet is not HTTP? This is just a test Servlet, the source of the request can be any other application generated request to the container. If catalina is supposed NOT to handle non-HTTP request, why the code here show me that it is trying to handle it and handle it in a buggy way? Maybe I am wrong, I find a "hard cast" in invoke too: private void invoke(ServletRequest request, ServletResponse response) throws IOException, ServletException { // Checking to see if the context classloader is the current context // classloader. If it's not, we're saving it, and setting the context // classloader to the Context classloader ClassLoader oldCCL = Thread.currentThread().getContextClassLoader(); ClassLoader contextClassLoader = context.getLoader().getClassLoader(); if (oldCCL != contextClassLoader) { Thread.currentThread().setContextClassLoader(contextClassLoader); } else { oldCCL = null; } // Initialize local variables we may need HttpServletRequest hrequest = (HttpServletRequest) request; HttpServletResponse hresponse = (HttpServletResponse) response ... Thsi has been fixed in 5.5.s and will be included in 5.5.29 onwards. |