How can I interrupt a request already sent to a JSP servlet engine, and thus stopping or altering the thread the server is executing for that request? For example I want to use a cancel button on my form's page to interrupt an already submitted request which may take a while to finish.

Bozidar Dangubic

STOP on the browser if your best bet. each request to the serlvet executes in its own thread. if you hit the CANCEL button on your form, you can program it so that it sends additional request to the servlet to (in your case) cancel previously sent request. however, you CANCEL request executes in the new thread on the server and therefore it really cannot stop the execution of the first thread which submitted the request in the first place. you could try to come up with some sophisticated thread management solution in your servlet engine where you have a class that manages worker threads that are created on each request to the servlet. but the solution is not straight forward so I cannot offer you some simple code sample you can just plug-in and make everything work. you would have to be really smart about the design and implementation of this especially if EJBs are involved in the request processing since they are really picky about threads.