File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Serlet calls another servlet 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 "Serlet calls another servlet" Watch "Serlet calls another servlet" New topic

Serlet calls another servlet

Brendan Kennedy
Ranch Hand

Joined: May 02, 2001
Posts: 65
How do you call one servlet from another without using a href or
anything like that, i.e. one servlet does a search, gets some
results back and then calls another servlet to display them.
sandy gupta
Ranch Hand

Joined: Jan 30, 2001
Posts: 228
Use the Request Dispatcher to fwd the request to the other servlet or use the response.sendRedirect method
Both will work
p.s: Careful about the fall-through nature of the 2 calls

Don't get me started about those stupid light bulbs.
subject: Serlet calls another servlet
Similar Threads
one servlet calling another servlet
A question about thread safety and servlets
How to update the browser address with the displayed page
A question about thread safety and servlets
what will be the output