tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 22290] - HttpServlet should use Wrapper class for doHead
Date Mon, 11 Aug 2003 06:53:57 GMT
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=22290>.
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=22290

HttpServlet should use Wrapper class for doHead

gregw@mortbay.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |



------- Additional Comments From gregw@mortbay.com  2003-08-11 06:53 -------

Note that even if this is/was legal, I think there is no harm
in using the wrappers provided here and it will reduce the code volume.

The way in which the spec gets violated is a little obscure, but
it depends on SRV.8.2 Using a Request Dispatcher, which says:

"To use a request dispatcher, a servlet calls either the include method or
forward method of the RequestDispatcher interface. The parameters to these
methods can be either the request and response arguments that were passed in via
the service method of the javax.servlet interface, or instances of subclasses of
the request and response wrapper classes that were introduced for version 2.3 of
the specification. In the latter case, the wrapper instances must wrap the
request or response objects that the container passed into the service method."

The problem occurs if I write a servlet based on HttpServlet and in doGet 
call a RequestDispatcher with the response that was passed in to doGet.  For
a HEAD method, this is not the response passed to the service method, nor is it
a wrapper of that object.

This leads to a class of errors for webapps that want/need to unwrap
to the objects passed to service not working for HEAD requests. I have 
actually seen such problems in the field.

cheers


cheers

Mime
View raw message