aspose file tools*
The moose likes Servlets and the fly likes Thread.sleep in servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Thread.sleep in servlet?" Watch "Thread.sleep in servlet?" New topic
Author

Thread.sleep in servlet?

Azrael Noor
Ranch Hand

Joined: Jul 29, 2010
Posts: 382
To keep track of application i have used multithreading in servlet as need was to run program on deploying, so contextlistener is used there. Some unexpected behaviors are facing in jboss 4.0



1) when thread run, it does not stop even server stopped or net beans is close.
2) during application startup servlet run, thread working fine. but when changes done to some class and redeploy is done it does not allow to deploy again.
3) Thread is very bad

Please solve the problem.
Thank you


Regards
Azrael Noor
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

What are you trying to achieve with this? Thread.sleep is a very questionable thing to want to be doing in a Servlet.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Shanky Sohar
Ranch Hand

Joined: Mar 17, 2010
Posts: 1051

Why you are writing code in servlets,BecauseAs per MVC,
Writing code within a servlet is not a good practice,you must have to use the servlet as controller only


SCJP6.0,My blog Ranchers from Delhi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thread.sleep in servlet?