• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Communication between Servlet and Thread

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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()
 
reply
    Bookmark Topic Watch Topic
  • New Topic