The HttpServlet.NoBodyResponse class implements HttpServletResponse. It should extend HttpServletResponseWrapper This is simpler and I think more legal - as it is unclear (to me at least) that the spec allows for arbitrary wrapper classes to be used.
Please cite the section of the Servlet-2.4 spec that you feel is violated if you REOPEN, since I can't find it.
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
Who is responsible for the servlet api classes? The Sun people or the tomcat people? If it is the Sun people - then shouldn't this be sent to the servletapi-feedback@eng.sun.com and set as resolved?
I have sent the following to servletapi-feedback@eng.sun.com The following bugs were reported against Tomcat. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10555 (tomcat 4) http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22290 (tomcat 5) I have resolved these bugs as INVALID for Tomcat as the NoBodyResponse class is part of the API spec (it is included in the API class files download) and is outside of our control. If you believe this is not the case, or can provide any other feedback that would be useful to add to our bug reports, please let me know. Regards, Mark Thomas
*** Bug 10555 has been marked as a duplicate of this bug. ***