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 Java Interview Guide this week in the Jobs Discussion 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

I agree. Here's the link:
subject: Serlet calls another servlet
It's not a secret anymore!