Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

sendRedirect doubt  RSS feed

 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a code sends a sendRedirect to a browser,if the sendRedirect is to some component in the same webapp,then will the new request be part of the same session?I know its a stupid thing to do as we can use forward,but I am curious to know how it will behave?
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you do a sendRedirect then a new request will be created whereas if you do forward then the same request will be forwarded to that resource.

Yes in case of sendRedirect to a resource in same application, same session will be accessible through that request object.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!