That's exactly what I'm trying to tell you.  Have another, simple applet
load before your chat applet that simply displays "5% complete...," "10%
complete...," etc.  as values calculated by the servlet and passed to the
utility applet using a persistent connection.  You can calculate these
percentages as an ongoing ratio of Content-Length to bytes sent through the
OutputStream that's sending your chat applet.  You could also display the
progress as a graphic using Swing (like Flash can do), but I think you want
to keep the footprint as small as possible.

Alternatively, you could use Flash.  It has a very small footprint and there
has been much discussion on this list regarding servlet-Flash
intercommunication (see archives).

Hope this helps....

Cheers!
Mark

----- Original Message -----
From: "Victor Gratchev" <[EMAIL PROTECTED]>
Sent: Saturday, July 07, 2001 6:15 PM


You must be not correctly understand me. I have chat wrote as applet.
But he is 40K byte length and on slow connection loading about 30
seconds and people see gray rectangle and think that it's error and
close window with applet they don't know that applet is loading... Can I
read some variable or something what show state of loading and show the
percent of loading in process of loading applet?

-----Original Message-----
From: Mark Galbreath [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 07, 2001 2:52 AM

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.

----- Original Message -----
From: "Victor Gratchev" <[EMAIL PROTECTED]>
Sent: Friday, July 06, 2001 5:30 AM

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

Reply via email to