aspose file tools*
The moose likes Servlets and the fly likes Communication between Servlet and Thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Communication between Servlet and Thread" Watch "Communication between Servlet and Thread" New topic
Author

Communication between Servlet and Thread

Gareth Western
Ranch Hand

Joined: Apr 07, 2004
Posts: 45
Hi,

I have a (Struts) servlet which launches a Thread to perform a lengthy process. I'd like the user to be able to make subsequent requests in order to get a progress update from the thread, so they have some idea of how long until the thread completes.

Can someone provide some information on how I could do this? Doesn't have to be a very long explanation, just pointers on where to start looking for more information.

Thanks!

Gareth
Travis Hein
Ranch Hand

Joined: Jun 06, 2006
Posts: 161
When you create the thread, can you place the handle to the thread instance onto the user's session?
Then the same user could see the status, any other page could session.getAttribute() to get the thread and ask thread.isAlive()


Error: Keyboard not attached. Press F1 to continue.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Communication between Servlet and Thread
 
Similar Threads
User created threads in serlvets
Chron jobs?
anybody have experience purchasing voucher from this link?
Starting process threads when Tomcat starts
passing information between servlets