Bug 44829 - HEAD request with STRICT_SERVLET_COMPLIANCE set causes ServletException if servlet performs a forward
HEAD request with STRICT_SERVLET_COMPLIANCE set causes ServletException if se...
Status: RESOLVED DUPLICATE of bug 44562
Product: Tomcat 6
Classification: Unclassified
Component: Servlet & JSP API
6.0.14
All Linux
: P2 normal (vote)
: default
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2008-04-15 20:18 UTC by Lucas Nelson
Modified: 2008-04-16 00:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Nelson 2008-04-15 20:18:42 UTC
1) run tomcat with the org.apache.catalina.STRICT_SERVLET_COMPLIANCE system property set to true
2) have some kind of "/index.jsp" page
3) have this servlet configured:
public class StrictForwardTestServlet extends HttpServlet
{
	protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException
	{
		req.getRequestDispatcher("/index.jsp").forward(req, resp);
	}
}
4) issue a GET on that servlet: success, you get the index.jsp content
5) issue a HEAD on that servlet: error (see below)

javax.servlet.ServletException: Original SevletResponse or wrapped original ServletResponse not passed to RequestDispatcher in violation of SRV.8.2 and SRV.14.2.5.1
	at org.apache.catalina.core.ApplicationDispatcher.checkSameObjects(ApplicationDispatcher.java:985)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:316)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
	at com.example.StrictForwardTestServlet.doGet(StrictForwardTestServlet.java:13)
	at javax.servlet.http.HttpServlet.doHead(HttpServlet.java:271)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:354)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
	at java.util.concurrent.ThreadPoolExecutor$Worker

I think this bug was introduced by the fix for bug 34956.
Comment 1 Mark Thomas 2008-04-16 00:18:27 UTC

*** This bug has been marked as a duplicate of bug 44562 ***