This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Servlets and the fly likes Questions about request dispatching Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Questions about request dispatching" Watch "Questions about request dispatching" New topic

Questions about request dispatching

Anshum Kocher

Joined: Nov 26, 2012
Posts: 5
1. When a servlet forward a incoming request to say a JSP any code i write after the forward call is redundant?
2. If the servlet ask the browser to issue a seprate request at redirection how are the request and response objects preserved?

Any responses would be greatly appreciated.
Amit Ghorpade

Joined: Jun 06, 2007
Posts: 2716

1) Any code that tries to writ to the output after is forward is of no use.
2) No they are not preserved for a fresh browser request (sendRedirect).
For more info, check this .

|Asking Good Questions|
I agree. Here's the link:
subject: Questions about request dispatching