wood burning stoves 2.0*
The moose likes Servlets and the fly likes How Can a servlet automatically send a response without a request ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How Can a servlet automatically send a response without a request ?" Watch "How Can a servlet automatically send a response without a request ?" New topic
Author

How Can a servlet automatically send a response without a request ?

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hello ,
I am trying to develop a simple Net game , wherin two users can LogIn and play against each other.
I have decided to use Servlets for this project.
The probelem is :
When one user makes certain moves on his screen the same has to be reflected to the other user as well, without the other user(or client) sending a request.How do we achieve that ?
Morever should i use anything other than Servlet for this ?
Thanx in advance,
Milan
prasad Chandrasekaran Iyer
Greenhorn

Joined: Jan 14, 2004
Posts: 18
Hi
i think u can use "refresh" and mention the time.

prasad
Irene Fernandez
Greenhorn

Joined: Jan 26, 1999
Posts: 15
I have a similar problem = refresh a page without the client making the explicit request to do so.
I am now using Jason Hunter's "Java Servlet Programming" O'Reilly Publisher. In Chapter 6:Sending MultiMedia Content, he describes 2 methods: 1)[Client pull] "the client uses the Refresh header value sent by the server to determine when to perform its update". He recommends this when the updates are infrequent or occur at known time intervals. 2)[Server push] Jason recommends this approach for "limited-length animations and for real-time updates". There is some example code. There is also an example chat server in Chapter 6:Applet-Servlet Communications. These two examples show two different ways for server push.
see the following: http://www.oreilly.com/catalog/jservlet/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How Can a servlet automatically send a response without a request ?
 
Similar Threads
how does the servlet knows that the client has closed the browser
how to request a hidden field value on servlet with post method?
Question related to banking project?
make a jdbc conecction pool from 0, using JSP, tomcat, mysql
Global Storage Of Values