• Post Reply Bookmark Topic Watch Topic
  • New Topic

difference between Jsp forward and sendRedirect

 
kotha vijaybabu
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please search the JSP and Servlet forums for this question, it is very common.

 
NandaM Kishore
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is misleading. Redirects can also be made, and frequently are, to resources within the same web application.
 
Shraddha Jain
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sendRedirect() is an instruction to the browser while forward() happens at server side, transparent to the browser.
 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx all of u

i got it

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!