File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How to get response in RequestDispatcher Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to get response in RequestDispatcher" Watch "How to get response in RequestDispatcher" New topic
Author

How to get response in RequestDispatcher

ying lam
Ranch Hand

Joined: May 17, 2004
Posts: 85
Hi,

In my doGet() of my servlet "Servlet0", i need to forward the request to another servlet.

So I did this:

But how can I get what is the response after Servlet1 handles it? Since i need to make modification in my Servlet0 before I finally response to the client (browser)

Thank you.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The answer is in the code you pasted.

The response gets passed to your servlet, you then pass it to the next servlet as an argument to the responseDispatcher.forward call.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
jQuery in Action, 2nd edition
 
subject: How to get response in RequestDispatcher
 
Similar Threads
servlet to servlet communication
Communication between servlets of two different applications
Forward between Web Apps - How To?
URL rewriting
Communication between servlets of two different applications in Tomcat