This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes What happens to the referrer in the header after Response.sendRedirect is called Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "What happens to the referrer in the header after Response.sendRedirect is called" Watch "What happens to the referrer in the header after Response.sendRedirect is called" New topic
Author

What happens to the referrer in the header after Response.sendRedirect is called

J.C. Bustamante
Greenhorn

Joined: Jul 20, 2009
Posts: 22
Hi,

I was wondering what happens to the referrer value in the HTTP header after the send redirect method is called on the response. How would we get the original referrer value if a sendRedirect is called?

Thanks,

Juan
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60766
    
  65

What did you discover when you tried it?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
J.C. Bustamante
Greenhorn

Joined: Jul 20, 2009
Posts: 22
Hi,

I discovered that the value was null. Although this was not a simple application that I was trying it with and it may not entirely be the reason of why the value could be null. I will try it with a smaller application and let you know the results.

Cheers,

Juan
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Recall that "sendRedirect" sends a response to the browser suggesting it should send a new request to a new URL. What would you expect might be the referrer of this new request?

And would you expect that the answer to this question would be different if you had a smaller application? Recall that the browser doesn't know anything about the size of your application.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What happens to the referrer in the header after Response.sendRedirect is called
 
Similar Threads
request.getHeader("Referer")
Bad Thread management (and URL decoding)
I want to only accept a connection when a person clicks a link from a seperate host and application.
Session time out error
Retrieve cookie values