javax.servlet.http.NoBodyResponse should not be private

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

javax.servlet.http.NoBodyResponse should not be private

Laurent Martelli
Hi,

I think javax.servlet.http.NoBodyResponse and
javax.servlet.http.NoBodyOutputStream should not be private classes so
that they can be usedwhen overriding doHead().

Regards,
Laurent

--
Laurent Martelli
[hidden email]                                Java Aspect Components
http://www.aopsys.com/                          http://jac.objectweb.org



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: javax.servlet.http.NoBodyResponse should not be private

Greg Wilkins-5
Laurent Martelli wrote:
> Hi,
>
> I think javax.servlet.http.NoBodyResponse and
> javax.servlet.http.NoBodyOutputStream should not be private classes so
> that they can be usedwhen overriding doHead().

I agree totally.... well almost totally.....
In fact I do not think it is the job of the servlet API to enforce the no-body
part of a HEAD request.  That is the job of the HTTP layer!

Anyway, while I'd like to help we cannot change these classes without causing
us to fail the conditions of the TCK spec compliance stuff.

Basically if there is a bug in the javax classes - at least everybody will have it!

cheers


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: javax.servlet.http.NoBodyResponse should not be private

Laurent Martelli
>>>>> "Greg" == Greg Wilkins <[hidden email]> writes:

  Greg> Laurent Martelli wrote:
  >> Hi,
  >>
  >> I think javax.servlet.http.NoBodyResponse and
  >> javax.servlet.http.NoBodyOutputStream should not be private
  >> classes so that they can be usedwhen overriding doHead().

  Greg> I agree totally.... well almost totally.....  In fact I do not
  Greg> think it is the job of the servlet API to enforce the no-body
  Greg> part of a HEAD request.  That is the job of the HTTP layer!

  Greg> Anyway, while I'd like to help we cannot change these classes
  Greg> without causing us to fail the conditions of the TCK spec
  Greg> compliance stuff.

I guess these 2 classes are implementation specific and are not part
of the spec. So maybe you could move them to a jetty specific package.

I also noticed that the default implementation of doHead() always sets
the Content-Length. And this is the reason why I had to override
it. Since HEAD request do not return a body, it is probably very
common optmization for dynamically generated pages, to not generate
the pages at all. This leads to a Content-Length of 0 which may fool
the browser into thinking the document is empty. I would say it's
probably better to leave out the Content-Length unless the
implementation sets it.

--
Laurent Martelli
[hidden email]                                Java Aspect Components
http://www.aopsys.com/                          http://jac.objectweb.org



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: javax.servlet.http.NoBodyResponse should not be private

Greg Wilkins-5

Of course if you are happy to always run in Jetty, you can just leave
out the NoBodyOutputStream and Jetty will remove the body for you.

The doHead code should be able to just call doGet and perform the
normal processing (and setting of headers) as it really should do.

Jetty should even make the same decisions about when to flush headers
etc. which could effect the choice of chunking or not chunking!

cheers



Laurent Martelli wrote:

>>>>>>"Greg" == Greg Wilkins <[hidden email]> writes:
>
>
>   Greg> Laurent Martelli wrote:
>   >> Hi,
>   >>
>   >> I think javax.servlet.http.NoBodyResponse and
>   >> javax.servlet.http.NoBodyOutputStream should not be private
>   >> classes so that they can be usedwhen overriding doHead().
>
>   Greg> I agree totally.... well almost totally.....  In fact I do not
>   Greg> think it is the job of the servlet API to enforce the no-body
>   Greg> part of a HEAD request.  That is the job of the HTTP layer!
>
>   Greg> Anyway, while I'd like to help we cannot change these classes
>   Greg> without causing us to fail the conditions of the TCK spec
>   Greg> compliance stuff.
>
> I guess these 2 classes are implementation specific and are not part
> of the spec. So maybe you could move them to a jetty specific package.
>
> I also noticed that the default implementation of doHead() always sets
> the Content-Length. And this is the reason why I had to override
> it. Since HEAD request do not return a body, it is probably very
> common optmization for dynamically generated pages, to not generate
> the pages at all. This leads to a Content-Length of 0 which may fool
> the browser into thinking the document is empty. I would say it's
> probably better to leave out the Content-Length unless the
> implementation sets it.
>



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: javax.servlet.http.NoBodyResponse should not be private

Pier Fumagalli-2
On 24 May 2005, at 10:53, Greg Wilkins wrote:
>
> Of course if you are happy to always run in Jetty

Oh, I didn't know there were other alternatives to it! :-P

     Pier



smime.p7s (3K) Download Attachment