Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Refresh Client from server

 
Serghei Jelauc
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic