This content has been marked as final. Show 1 reply
Threads are always detached from the code that starts it and run completely isolated. You can start a thread, let the doGet()/doPost() end and the thread will continue on its merry way. Of course you won't be able to send response on what it is doing.
The question is: should you start a thread in a servlet. The application server / servlet container can maintain its own thread pool for the services it provides (web services, EJBs, MDBs, etc.) and if you start spawning threads on your own you can interfere with it. You should research that a little about the server you are using, I know that under JBoss for example it is at the very least discouraged to do so.