This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes How to get response in RequestDispatcher Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply 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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to get response in RequestDispatcher
 
Similar Threads
servlet to servlet communication
Communication between servlets of two different applications
Communication between servlets of two different applications in Tomcat
URL rewriting
Forward between Web Apps - How To?