Two Laptop Bag*
The moose likes Servlets and the fly likes How kick off servlet (requestdispatcher . include) in another thread? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How kick off servlet (requestdispatcher . include) in another thread?" Watch "How kick off servlet (requestdispatcher . include) in another thread?" New topic
Author

How kick off servlet (requestdispatcher . include) in another thread?

Robert Paris
Ranch Hand

Joined: Jul 28, 2002
Posts: 585
I have a servlet that's executed currently by calling the request dispatcher and then calling "include()". What I want to do is execute that servlet in a different thread (so my JSP can return), while providing it with the request and response objects.
1. How do I do this?
2. Are there any deployment/init/config things I need to do to enable my servlet for this?
thanks!
Steve Chernyak
Ranch Hand

Joined: Oct 19, 2000
Posts: 113
I am not sure what the requirements are, but whenever i need to do asynch. processing I just create a class and have it execute in its own thread.
You could pass the request object to it or retrieve the data from the request and pass it in its own class. I am not sure if the response will be of any use since you probably wont be able to write to it.
Hope this helped.
 
Consider Paul's rocket mass heater.
 
subject: How kick off servlet (requestdispatcher . include) in another thread?
 
Similar Threads
the availabilty of request object
Request Dispatch Problem
Use of request dispatcher's include method
servlet container and multi threading
Thread running withing a servlet