File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Refresh Client from server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Refresh Client from server" Watch "Refresh Client from server" New topic
Author

Refresh Client from server

Serghei Jelauc
Ranch Hand

Joined: Jul 24, 2002
Posts: 128
Hi all.
I have the next question about JSP.
How can I refresh clients pages from server? For example if there is JSP chat. Every time when new user enter in chat, its name must appear in list of users. But if you enter before this user, you page must be refreshed (with out you push sent button or something else) from server.
How I can do it?
thanks in advance.


SCJP 1.4 <br />SCBCD 1.3<br />SCWCD 1.4
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
If you are using just regular servlets or JSP producing HTML pages, you can't do this. The nearest you can come is to get the page in the client browser to refresh itself every few minutes to check if anything has happened.
If you really need more than this, you probably need an applet, or even a proper application, running on the client machine. Web pages, even with JavaScript or DHTML, are essentially dumb, static things. They cannot listen for external messages from remote machines.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
 
subject: Refresh Client from server
 
Similar Threads
How to get search criteria:Field vs ComboBox
group chat
xml and chat.
Simple Chat Application with JSP/ Servlets
how to differ between new request and page refresh..