You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2003/03/06 19:39:11 UTC
DO NOT REPLY [Bug 17736] New: -
RequestDispatcher.include/forward deal checked Exception incorrectly
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: tomcat-dev@jakarta.apache.org
ReportedBy: dianne.jiao@sun.com
CC: Ryan.Lubke@Sun.COM
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: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org