RVASUDEV wrote:
> Hi,
>
> [Java 1.1.6, JSDK 2.1, HP-UX 10.20]
>
> Could anyone please explain the comment below.
>
It refers to the fact that the HTTP/1.1 protocol can support "persistent
connections" across which you can make more than one request/response
transaction with your server. This capability has to be supported by both
browser and server, and one of the restrictions generally imposed is that you
always need to specify the content length for this to work.
Note that the use of HTTP/1.1 persistent connections has absolutely no impact
on your programming approach to servlets (or JSP pages), other than the
mandate to set the content length. The only difference is a potential
performance improvement -- how big depends on how long it takes to establish a
TCP connection for each request (which is what happens in HTTP/1.0 or when you
don't set the content length) versus once.
See the HTTP/1.1 specification for more information.
Craig
>
> This is from the source code for the doGet method in
> <jsdk2.1-dir>/src/javax/servlet/http/HttpServlet.java
>
> * If you can set the Content-Length header (with the
> * {@link javax.servlet.ServletResponse.#contentType} method),
>
> * the servlet
>
> * can use a persistent connection to return its response
>
> * to the client, improving performance dramatically.
>
> * If you cannot set Content-Length, you can sometimes avoid
>
> * the performance penalty if the response fits in an internal
>
> * buffer.
>
> *
>
> TIA
>
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> Vasudev Ram
> Infosys Technologies Limited
> Pune, India
> Email : [EMAIL PROTECTED]
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
> ___________________________________________________________________________
> 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