• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

jsp:forwardand response.sendRedirect

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
I want to know the diffrence between thsese two redirecting tag.
Actually i hv read the difference in many BOOK and on sites also.But I cud not able to know that where we shud use response.sendRedircet and where <jsp:forward></jsp:forward>.
How i can i see the differenrc when I run Both.
Plzz tell me the case in which only one them can work..it is neccasary to use the specific one.
 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, but a search on this forum, or google, would probably reveal more than 100 questions which are all the same as this one.
Before giving you an answer, please take the effort to use the forum search, or google search.
Thank you.
Erik
 
Nadeem Ahmad
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I hv searched many times and i got the solution in the Bokks also but as I hv eritten that i cud not get the correct one.
Actaully i told in an interview the same thing which i hv read in the books and on the Net.
Plz tell me where can we use these url redirection specificly
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Redirect---> transfer control to any url in the web.
Forward---->it works with in the container.
 
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, it's actually a little deeper than that.
When you perform a redirect, the response is sent back to the browser with headers that instruct the browser to create a new request to the redirect URL. The important part of this is that a redirect causes the current request to end, and a new one to be generated, perhaps elsewhere.
A forward sends the current request to another resource within the web application. The forward does not return a response to the browser, and no new request is generated.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic