File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Delayed Response\Server Push Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Delayed Response\Server Push " Watch "Delayed Response\Server Push " New topic
Author

Delayed Response\Server Push

Hema Menon
Ranch Hand

Joined: Oct 29, 2000
Posts: 569
Hi,
Does anyone knows how to delay a response for a request made to a servlet?
Client browsers make a request to a servlet on a web server, and the response from the server should be delayed until the server get some external notification event.
Any suggessions!
Thanks
-hm


~hm
Andrew Shafer
Ranch Hand

Joined: Jan 19, 2001
Posts: 338

What is the time frame on the delay?
What mechanism would be reporting to the servlet?

A project I'm working on uses Runtime.getRuntime().exec() to create a Process that requests some calculations.
Process.waitFor() is a method that ensures the process is finished.
Maybe this will give you some ideas.
Please give more specific detail about what you want to do exactly.


!_I_Know_Kung_Fu_!
Hema Menon
Ranch Hand

Joined: Oct 29, 2000
Posts: 569
Hi Andrew,
I am working on an idea, where some client browser would connect to a web server(may be a servlet application, somewhat like a login process and say, hi I am ready). The webserver will be notified by an external application(again may be by a servlet request)when some data is collected( Somewhat like collecting information from a database). When the server get this notification, it should pop up a response on to the client browsers with this data.
The options I have is -
Client would poll the server to see if the server has the data.
But this is not a recommended solution. The better option is to poll but at a greater timeout, or the server delay the response of the client request until it receives the data.
Any suggestions welcome.
Thanks
-hm
 
 
subject: Delayed Response\Server Push
 
Threads others viewed
servlet does not contain main()
When Should we create a Schema Object ? Is dividing the Database into schema a good practice ?
TimerTask and Execute
request scope for 3-4 pages
Time delays inbetween forwarding of jsp pages?
developer file tools