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 2002/07/08 16:51:03 UTC

DO NOT REPLY [Bug 10555] New: - doHEAD breaks spec SRV 8.2

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=10555>.
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=10555

doHEAD breaks spec  SRV 8.2 

           Summary: doHEAD breaks spec  SRV 8.2
           Product: Tomcat 4
           Version: 4.1.6
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Servlet & JSP API
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: gregw@mortbay.org


The HttpServlet.doHead method is

 protected void doHead(HttpServletRequest req, HttpServletResponse resp)
	throws ServletException, IOException
    {
	NoBodyResponse response = new NoBodyResponse(resp);
	
	doGet(req, response);
	response.setContentLength();
    }

where

  class NoBodyResponse implements HttpServletResponse {...}



This breaks older versions of Jetty if a head request is
passed to a request dispatcher.  This is because Jetty used
to enforce the SRV 8.2 and the javadoc for RequestDispatcher 
that says

 * The request and response parameters must be either the same
 * objects as were passed to the calling servlet's service method or be
 * subclasses of the {@link ServletRequestWrapper} or 
 * {@link ServletResponseWrapper} classes that wrap them.


Thus the doHead mechanism breaks this because NoBodyResponse
does not extend HttpServletResponseWrapper.

The NoBodyResponse should extend the wrapper, so that containers can
enforce the SRC8.2 if they wish.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>