The differences are as follows:-
Sno |
forward() Method |
sendRedirect() Method |
1 |
The forward method implicitly called by the servlet |
The sendRedirect() method is used for instruct the browser for url jump from orignal to the other one. |
2 |
The browser is unaware about the on going of this method, so its url remain constant |
In this method the brower knows and do the work for making new request. |
3 |
If the brower window get refreshed then the url is relaoded with the same request and remain persisit. |
The browser reload the second url and will not repet the orignal or old request but loads the second url |
4 |
Forward methods works within the methods only. |
SendRedirect works in and outside of the srver |