File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Dispatching Request to multiple servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Dispatching Request to multiple servlets" Watch "Dispatching Request to multiple servlets" New topic

Dispatching Request to multiple servlets

Sharika Raj

Joined: Aug 31, 2004
Posts: 26
Hi ,
I don't have any experience in servlets/JSP.I am reading HF book. I have a doubt about RequestDispatch. In Chapter 3 I did the example which forwards the request to a JSP Page.My doubt is how to dispatch if I want to to send same request to multiple servlets and collect their responses and finally send a single response back to client? Is it possible to dispatch to multiple servlets? Is there a way to get the control back once those servlets finish thier work?

Anand Ko
Ranch Hand

Joined: Dec 03, 2003
Posts: 79
Use RequestDispatcher.include (request, response)

Anand<br />SCJP 1.4, SCWCD 1.4, SCEA 5.0(1/3)
Kumar J
Ranch Hand

Joined: Feb 13, 2005
Posts: 35
once you have dispatched...the only way to make use of the same request and response to further dispatch is to do it from this servlet/jsp to which you have dispatched...else you have to use include...


With Regards,<br />Kumar J
Bhumika Thakkar
Ranch Hand

Joined: Apr 18, 2005
Posts: 79
There is no way to do it concurrently, as said before use include or dispatch in a chain.

SCBCD (Preparing) <br />SCWCD, 82%<br />SCJP, 90%
Sharika Raj

Joined: Aug 31, 2004
Posts: 26
Now I got it.

Thanks a lot
I agree. Here's the link:
subject: Dispatching Request to multiple servlets
jQuery in Action, 3rd edition