Manish Bhatnagar wrote:
> But that would also include header information...
>
That is not correct -- the content length represents only the content, not the
headers.
However, it won't answer the original question, either. The
request.getContentLength() method will only tell you how many content bytes were
received on the *request*, not how many bytes were written in the *response*.
For the latter requirement, the only portable way to do this is if you are
running on a servlet container implementing the new Servlet 2.3 API (like Tomcat
4.0). In such an environment, you can create a Filter implementation that
watches all of the responses, and figures out how many bytes were written (you
will need to create a custom wrapper around the ServletResponse to accomplish
this). Otherwise, you will need to dig inside your servlet container for a
mechanism to acquire this information.
Craig McClanahan
>
> Abhay wrote:
>
> > You can use request.getContentLength();
> >
> > Abahy
> >
> > ----- Original Message -----
> > From: Morten Holm <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, November 27, 2000 5:44 PM
> > Subject: How many bytes was written?
> >
> > > Hi,
> > >
> > > > I need to know how many bytes was written from my Servlet/JSP.
> > > >
> > > > Is there any way to obtain this information through the Servlet API?
> > >
> > > Morten
> > >
> > >
> > ___________________________________________________________________________
> > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> > body
> > > of the message "signoff SERVLET-INTEREST".
> > >
> > > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > > Resources: http://java.sun.com/products/servlet/external-resources.html
> > > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
> > >
> >
> > ___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> --
> +----------------------------------------------Live-Your-Dream----+
> Obstacles are things a person sees when he takes his eyes off his goal.
> -E.
> Joseph Cossman
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html