Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread.sleep in servlet?

 
Azrael Noor
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you trying to achieve with this? Thread.sleep is a very questionable thing to want to be doing in a Servlet.

 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic