Yes.  Most servers internally manage the Content-Length header for the
static files they serve; the Content-Length is set to match the file's
length.  To determine the content length of servlet-generated output, a
server requires the servlet's assistance.  A servlet can set the response
Content-Length and gain the advantages of a persistent connection for its
dynamic content by using the setContentLength() method of

public void ServletResponse.setContentLength( int len)

This method sets the length (in bytes) of the content being returned by the
server.  In an HTTP servlet, the method sets the HTTP Content-Length header.
Using this will allow your servlets to be able to take advantage of
persistent connections when they are available.  Your applet will be able to
display an accurate progress monitor during the download.

See Jason Hunter's "Java Servlet Programming, 2d Ed.," pp. 132-133 for more
details.

Cheers!
Mark

----- Original Message -----
From: "Victor Gratchev" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 06, 2001 5:30 AM
Subject: How I can make my applet show something when loading instead of
gray background?


Can I make my applet show percents of loaded like flash?

___________________________________________________________________________
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

Reply via email to