very true, if u try to make the browser hang on for too long then
eventually something will timeout (either on the client side or server
side)
so as many here have suggested the best way is to refresh with javascript
or a meta-refresh
but ... an even nicer solution is to create a hidden frame that has ur
javascript/meta-refresh code, in this hidden frame u can have all ur logic
that checks the server and can instruct the visible frame to refresh only
when it has to
Thanks,
Alan Czajkowski
-------------------------------------
Database Administrator
BMO Financial Group
Decision Support Services
3300 Bloor Street West
14th Floor, West Tower
Toronto, Ontario, M8X 2X2
Tel: 416.232.8736
-------------------------------------
"Shapira, Yoav" <[EMAIL PROTECTED]>
16/12/2003 10:41 AM
Please respond to "Tomcat Users List"
To: "Tomcat Users List" <[EMAIL PROTECTED]>
cc:
Subject: RE: Having problems with stored PrintWriter.
Howdy,
>Im trying to create a servlet that is able to push back to the browser
>rather than just operate a a pull mechanism.
>
>
>To create this, there is a piece of javascript embedded within the html
>outputted to the browser, so when additional javascript code is written
in
>at a later stage calling that function, that user can be notified of
events
>he is registered to.
You can have the JavaScript reload the page from your servlet, i.e.
giving the servlet a new request. This is a common solution.
>Perhaps not the way servlets were made to work but anyway!
That's a big "but anyway" -- probably too big.
>Unless you are able to come up with a better solution?
Depends what your design goal is. A web server pushing stuff onto
clients? Not my cup of tea, as you observed that's now how the web
works. Clients requests, servlets (as their name implies) and more
generally web servers (as their name also implies) serve.
>How do i stop the response from ending then? I have left the html open
at
>the end so no /html code and I have not closed the output to the
browser.
Eventually, something will time out. The browser, the server, your
firewall, many things can and will terminate the connection.
Yoav Shapira
This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential,
proprietary and/or privileged. This e-mail is intended only for the
individual(s) to whom it is addressed, and may not be saved, copied,
printed, disclosed or used by anyone else. If you are not the(an)
intended recipient, please immediately delete this e-mail from your
computer system and notify the sender. Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]