Explain the difference between response.sendRedirect and forward methods

Questions by basvoju

Showing Answers 1 - 2 of 2 Answers

The difference b/w response.sendRedirect and forward is that, the request is send back to the browser and request is taken back from the browser when user submits. While forward forwards the response to another servlet with request and reponse object with it.

  Was this answer useful?  Yes

srinivas

  • Jul 25th, 2006
 

when client gives req to a servlet response.sendredirect() method partially delegates the control to another servlet or jsp by giving request to that,and recieves the response from that servlet.then our requested servlet includes the response of its own and another servlet,and that willbe passed to the client.that means client doesnot knowthat control goes to another servlet,that willbe happened internally.

incaseof forward() method control permanently goes to another servlet.the output ofthe first servlet willbe discarded.The only response of redirected servlet willbe displayed to the browser.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions