Enhancement request

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

Enhancement request

Ceki Gulcu-2
Hello,

During the development of an advanced access logger implementing
Jetty's RequestLog interface, I ran into the following problems which
all involve either the o.m.jetty.Request or o.m.jetty.Response
classes.

Content length
==============

I need to determine the number of bytes written in the
response. Currently, NCSARequestLog computes the content length as
follows:

    request.getConnection().getGenerator().getContentWritten();

However, the getGenerator() method in HttpConnection class is not
visible outside the o.m.jetty package.

In their implementation of HttpServletResponse, both Resin and Tomcat
offer methods that return the number of bytes written out. These
methods are named getContentLength() and getContentCount(), for Resin
and respectively Tomcat. Could you please add a similar method in
o.m.jetty.Response? Alternatively, could the getGenerator() method in
HttpConnection class declared as public?

Response header
===============

Although the addHeader() and setHeader() methods are part of it, there
is no getHeader() method in javax.servlet.http.HttpServletResponse.
Both Resin and Tomcat offer a getHeader(String) method in
their respective implementations. If possible, could you please add a
getHeader() method in o.m.jetty.Response?

Processing duration in milliseconds
===================================

In order to compute the time it took to process the request, it is
very useful to know when the request was received. The
o.m.jetty.Request class already contains the getTimeStamp() which
returns a long. Resin's HttpServletRequest implementation contains a
similar method. As experts participating in the Servlet API
specification, would it be possible to lobby to add such a method in
the standard HttpServletRequest interface?

Status code
===========

The HttpServletResponse class contains a public setStatus method but
surprisingly enough it has no getStatus() method. Moreover, Jetty,
Resin and Tomcat all offer methods to get the status code. These
methods are respectively named getStatus(), getStatusCode() and
getStatus().  As experts participating in the Servlet API
specification, would it be possible for you to lobby to add a
getStatus() method in the standard HttpServletResponse interface?


I hope you will find the above reasonable,


--
Ceki Gülcü



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Enhancement request

Ceki Gulcu-2

My apologies for sending this in twice. I was not intending to spam.

At 11:14 AM 2/16/2006, you wrote:

>Hello,
>
>During the development of an advanced access logger implementing
>Jetty's RequestLog interface, I ran into the following problems which
>all involve either the o.m.jetty.Request or o.m.jetty.Response
>classes.
>
>Content length
>==============
>
>I need to determine the number of bytes written in the
>response. Currently, NCSARequestLog computes the content length as
>follows:
>
>    request.getConnection().getGenerator().getContentWritten();
>
>However, the getGenerator() method in HttpConnection class is not
>visible outside the o.m.jetty package.
>
>In their implementation of HttpServletResponse, both Resin and Tomcat
>offer methods that return the number of bytes written out. These
>methods are named getContentLength() and getContentCount(), for Resin
>and respectively Tomcat. Could you please add a similar method in
>o.m.jetty.Response? Alternatively, could the getGenerator() method in
>HttpConnection class declared as public?
>
>Response header
>===============
>
>Although the addHeader() and setHeader() methods are part of it, there
>is no getHeader() method in javax.servlet.http.HttpServletResponse.
>Both Resin and Tomcat offer a getHeader(String) method in
>their respective implementations. If possible, could you please add a
>getHeader() method in o.m.jetty.Response?
>
>Processing duration in milliseconds
>===================================
>
>In order to compute the time it took to process the request, it is
>very useful to know when the request was received. The
>o.m.jetty.Request class already contains the getTimeStamp() which
>returns a long. Resin's HttpServletRequest implementation contains a
>similar method. As experts participating in the Servlet API
>specification, would it be possible to lobby to add such a method in
>the standard HttpServletRequest interface?
>
>Status code
>===========
>
>The HttpServletResponse class contains a public setStatus method but
>surprisingly enough it has no getStatus() method. Moreover, Jetty,
>Resin and Tomcat all offer methods to get the status code. These
>methods are respectively named getStatus(), getStatusCode() and
>getStatus().  As experts participating in the Servlet API
>specification, would it be possible for you to lobby to add a
>getStatus() method in the standard HttpServletResponse interface?
>
>
>I hope you will find the above reasonable,
>
>
>--
>Ceki Gülcü

--
Ceki Gülcü



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642">http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Enhancement request

Greg Wilkins-5
In reply to this post by Ceki Gulcu-2
Ceki Gülcü wrote:
> Hello,
>
> During the development of an advanced access logger implementing
> Jetty's RequestLog interface, I ran into the following problems which
> all involve either the o.m.jetty.Request or o.m.jetty.Response
> classes.

See inline....

> Content length
> ==============
>
> I need to determine the number of bytes written in the
> response. Currently, NCSARequestLog computes the content length as
> follows:
>
>    request.getConnection().getGenerator().getContentWritten();
>
> However, the getGenerator() method in HttpConnection class is not
> visible outside the o.m.jetty package.
>
> In their implementation of HttpServletResponse, both Resin and Tomcat
> offer methods that return the number of bytes written out. These
> methods are named getContentLength() and getContentCount(), for Resin
> and respectively Tomcat. Could you please add a similar method in
> o.m.jetty.Response? Alternatively, could the getGenerator() method in
> HttpConnection class declared as public?

I've added getContentCount() to Response.


> Response header
> ===============
>
> Although the addHeader() and setHeader() methods are part of it, there
> is no getHeader() method in javax.servlet.http.HttpServletResponse.
> Both Resin and Tomcat offer a getHeader(String) method in
> their respective implementations. If possible, could you please add a
> getHeader() method in o.m.jetty.Response?

Done.  also getHeaders() for completeness


> Processing duration in milliseconds
> ===================================
>
> In order to compute the time it took to process the request, it is
> very useful to know when the request was received. The
> o.m.jetty.Request class already contains the getTimeStamp() which
> returns a long. Resin's HttpServletRequest implementation contains a
> similar method. As experts participating in the Servlet API
> specification, would it be possible to lobby to add such a method in
> the standard HttpServletRequest interface?

Will try.... but nothing will get in 2.5 now, so it will have to be in 3.0


> Status code
> ===========
>
> The HttpServletResponse class contains a public setStatus method but
> surprisingly enough it has no getStatus() method. Moreover, Jetty,
> Resin and Tomcat all offer methods to get the status code. These
> methods are respectively named getStatus(), getStatusCode() and
> getStatus().  As experts participating in the Servlet API
> specification, would it be possible for you to lobby to add a
> getStatus() method in the standard HttpServletResponse interface?


ditto.

> I hope you will find the above reasonable,

Totally.

in svn trunk soon(ish)


 
>



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss