What is the difference betweenresponse.sendRedirect()RequestDispatcher rd=getRequestDispatcher()rd.forward();

Questions by questioninterest

Showing Answers 1 - 5 of 5 Answers

vamsi

  • Aug 9th, 2006
 

The major differenceses are as follows

1,response.sendredirect will redirect by hitting the client and request dispatcher won't hit client in case if the redirecting is intended to other servlet or jsp page if the response is not intended for client

2,response.sendredirect wastes on cycle of network calls where a request dispatcher won't

3,but there is no need to create a object for each redirect like request dispatcher

  Was this answer useful?  Yes

Praveen

  • Aug 11th, 2006
 

The request scope is maintained in the request.dispatch technique, where as in send.redirect, the request scope is lost.

  Was this answer useful?  Yes

rajkumar

  • Feb 21st, 2007
 

hi
                   The Primary difference between res.sendRedirect and rd.forward is.In case of forward the webcontainer forwards the request to  a resource available within the same server whereas in case of send Redirect it redirects the client to a resource available in another webcontainer.

  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