This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When, JSP action forward and redirect to be used?

 
jacob deiter
Ranch Hand
Posts: 584
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When, JSP action forward and redirect to be used?
 
Surya Kant
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The functionality is same as servlet's forward & redirect
Forward will forward the request & where as redirect will create new request & send it
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A forward reuses the current request for the new destination. Use it if you want to have access to the initial request.

A redirect lets the client send a brand new request to the server. Use it if you want to get rid of the initial request.
 
jacob deiter
Ranch Hand
Posts: 584
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A forward reuses the current request for the new destination


Then In the new destination,i can get all parameter of old request???
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Certainly. You have the same instance at your hands.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic