I am using servlet there is two method redirect and forward both are send request to the same page but what is the difference between them.any idea
+3
A:
redirect - it uses a browser redirect. It sends an http response with code 3xx (see wikipedia), and then the browser makes another request to the new page
forward - forward is internal for the servlet container. The browser never understands that the page has changed. Hence the URL doesn't change (like with redirect), and you have the same request in the new page as well.
Bozho
2010-04-07 11:26:56
nice thanks Bozho
Sanjeev
2010-04-07 12:19:28
+1
A:
To add to the points written above, Redirect means at Client side and forward means at server side. So It means that one can redirect its page to some other application from the current application because it's hapening at browser side but in forward the it forward to some jsp or servlet for the same application.
Shashank T
2010-04-22 10:06:53