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.
The moose likes JSP and the fly likes difference between Jsp forward and sendRedirect Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "difference between Jsp forward and sendRedirect" Watch "difference between Jsp forward and sendRedirect" New topic
Author

difference between Jsp forward and sendRedirect

kotha vijaybabu
Ranch Hand

Joined: Jan 28, 2006
Posts: 77
hi all...

what is the difference between Jsp forward and send redirect

what happen when we use these things

plz.....explain in detail

vijay

[ March 03, 2006: Message edited by: kotha vijaybabu ]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Please search the JSP and Servlet forums for this question, it is very common.

NandaM Kishore
Greenhorn

Joined: Mar 03, 2006
Posts: 11
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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56204
    
  13

That is misleading. Redirects can also be made, and frequently are, to resources within the same web application.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Shraddha Jain
Greenhorn

Joined: Feb 02, 2006
Posts: 27
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
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
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
kotha vijaybabu
Ranch Hand

Joined: Jan 28, 2006
Posts: 77
thanx all of u

i got it

 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: difference between Jsp forward and sendRedirect
 
Similar Threads
sendRedirect & forward
servlets
Request dispatcher
what is the difference between forward and sendredirect
difference between forward and include