File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
How to get response in RequestDispatcher
Joined: May 17, 2004
Mar 07, 2008 21:46:00
In my doGet() of my
"Servlet0", i need to forward the request to another servlet.
So I did this:
RequestDispatcher dispatcher = request .getRequestDispatcher("Servlet1"); dispatcher.forward(request, response);
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)
Joined: Dec 11, 2004
Mar 10, 2008 05:58:00
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.
How to ask a question...
Simple Servlet Examples
subject: How to get response in RequestDispatcher
servlet to servlet communication
Forward between Web Apps - How To?
Communication between servlets of two different applications
Communication between servlets of two different applications in Tomcat
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015