• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Threads in Servlets

 
Girish Babu
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Can any body please let me knw if there is going to be any problem if i create multiple threads in a Servlet,

thanks in advance,
girish
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlets are already multi threaded.
What are you trying to do?
 
Marcos Urata
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the same doubt. There is a funcionality on my system that is Download of reports.

The thing is that the download files are quite big (about 50 MB) and are created on the fly. Because it can take a while to download the file, I created some methods to show the status of the download. So, to do that, I created a new thread on my servlet, which main and only purpose is to prepare the report file to be downloaded and zip it on the end.

The html client form is refresh from 5-to-5 seconds, so that they can see the progress of the download.

Is this a good aproach?

Thanks
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's how I do it.

I don't create the threads myself because the long running process occurs in the database but the concept is the same.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic