Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to access Location header in send redirect

 
Marc Solly
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
This is my first message.I was reading the difference between send redirect and forward from HFSJ.
first of all i want to tell about my understanding for this topic.
1)When we say send redirect it sets the header name Location with the new URL where servlets want to redirect..Is that right???
2)If first point is right then my question is Can the client i.e browser or (any JSP) can access this location header in between before redirecting this to new location....
thanks
Marc

 
Arvind Sampath
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Marc !

1)When we say send redirect it sets the header name Location with the new URL where servlets want to redirect..Is that right???


Well, the sendRedirect(url) method sets some property in the response header to the url specified. Am not sure if it is *Location*

Can the client i.e browser or (any JSP) can access this location header in between before redirecting this to new location....


Of course, the browser accesses this header, gets the value (i.e) the url to be redirected, and sends a request to that url. A Jsp will not be able to access this information because a JSP is NEVER a client program. If you write your own browser software, may be you will be able to manipuate that header.

Cheers,
Arvind
 
Marc Solly
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arvind,
Thanks For your reply

Marc
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic