Project: Tomcat
Bug 30949 After Failed Include, Request and Response not Unwrapped
Reported: 2004-08-30 23:54:36 | Status: resolved fixed

In org.apache.catalina.core.ApplicationDispatcher.doInclude(ServletRequest request, ServletResponse response), after invoke() is called to perform the include, the request and response objects are normally unwrapped. However, if a ServletException or IOException is thrown, the unwrapping does not take place. This leads to problems in environments in which cross context includes are being performed. For example, 1. Web App A performs an include to a Servlet in Web App B 2. The Servlet in Web App B throws a ServletException 3. Web App A catches the ServletException and attempts to forward to an error jsp. Step 3 above will fail due to the fact that the request has not been unwrapped. The active request will contain the ServletContext of web app B and the jsp file will not be found.

Files changed in fix:
java/org/apache/catalina/core/ApplicationDispatcher.java