• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP(forward & sendredirect)

 
ram kumar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
could any please explain me about the <jsp:foward> tag and <% response.sendRedirect %>.what's the difference between the two and at what condition should i use <jsp:forward> and sendRedirect ???
awaiting for your reply -- urgent
ram
 
Brian Nice
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi-
<jsp:forward> forwards the request on to another JSP, servlet, or static resource. This means the new object is able to access the parameters or whatever is attached to the request object. You can even add new paramters within the forward tags.
sendredirect actually causes a new HTTP request to happen, thus you lose everything from the initial request.
HTH
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!