This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Please search the JSP and Servlet forums for this question, it is very common.
NandaM Kishore
Greenhorn
Joined: Mar 03, 2006
Posts: 11
posted
0
A simple difference is.. We will forward a request to another resource(another servlet/JSP)which is in the same context ie., in the same appication/war file. whereas we will redirect the request to another resource if that resouce is in another web application ie.,if the resource is in some other war file
sendRedirect() is an instruction to the browser while forward() happens at server side, transparent to the browser.
Renu Radhika
Ranch Hand
Joined: Oct 21, 2005
Posts: 243
posted
0
The sendRedirect() method sends a message from servlet to the browser to get the resource from elsewhere whereas the forward() method forwards the request from one servlet to another servlet from within the server and wont send a message to the browser to do the same.
NandaM Kishore
Greenhorn
Joined: Mar 03, 2006
Posts: 11
posted
0
Yes, what bear says is right.sendRedirect can also be used to reuest another resource which is in the same application. I regret that I couldnt give you clear information