DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17736>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17736 RequestDispatcher.include/forward deal checked Exception incorrectly Summary: RequestDispatcher.include/forward deal checked Exception incorrectly Product: Tomcat 5 Version: 5.0.1 Platform: Sun OS/Version: Solaris Status: NEW Severity: Major Priority: Other Component: Servlet & JSP API AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Using RequestDispatcher in Servlet1 to include or forward to Servlet2, IOException thrown in Servlet2 didn't get propagated property back to Servlet1, exception type is lost. Code in Servlet1: public void includeCheckedException(ServletRequest request, ServletResponse response) throws ServletException, IOException { PrintWriter pw = response.getWriter(); String path = "include/IncludedServlet?testname=checkedException"; RequestDispatcher rd = request.getRequestDispatcher(path); if ( rd == null ) pw.println( "Null RequestDispatcher got for path=" + path); else { try { rd.include(request, response); pw.println("Test FAILED with no propagation of IOException from " + "IncludedServlet to TestServlet."); } catch (IOException e) { pw.println("Test PASSED with proper propagation of IOException " + "from IncludedServlet to TestServlet:" + e.getMessage()); } catch (Exception ex) { pw.println("Test FAILED with propagation of IOException from " + "IncludedServlet to TestServlet - wrong type of " + "Exception caught by TestServlet: " + ex.getMessage()); } } } Code In Servlet2: public void checkedException(ServletRequest request, ServletResponse response) throws ServletException, IOException { throw new IOException("IOException_from_checkedException"); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]