Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to get referrer page with in JSP

Reply
Thread Tools

How to get referrer page with in JSP

 
 
Steven
Guest
Posts: n/a
 
      02-04-2005
Hi All,

I want to be able to get the referring url in a JSP page. How would I do
this?
So if there is a page http://www.website.com/mypage.htm and it links to my
page : http://www.mywebsite.com/info.jsp I would like to be able to get the
url 'http://www.website.com/mypage.htm' and put it into some variable so I
can do something with it.

Thanks!

Steven.


--
Posted by news://news.nb.nu
 
Reply With Quote
 
 
 
 
Matthias Fraass
Guest
Posts: n/a
 
      02-04-2005
Hi Steven,

Steven wrote:

> Hi All,
>
> I want to be able to get the referring url in a JSP page. How would I do
> this?


Try
request.getHeader("referer");

Matthias
 
Reply With Quote
 
 
 
 
Roland
Guest
Posts: n/a
 
      02-04-2005
On 4-2-2005 12:15, Matthias Fraass wrote:

> Hi Steven,
>
> Steven wrote:
>
>> Hi All,
>>
>> I want to be able to get the referring url in a JSP page. How would I
>> do this?

>
>
> Try
> request.getHeader("referer");
>
> Matthias

Shouldn't that be
request.getHeader("Referer");
AFAIK, header names are case-sensitive, including the HTTP Referer header.
--
Regards,

Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
 
Reply With Quote
 
Matthias Fraass
Guest
Posts: n/a
 
      02-04-2005
Roland wrote:

> On 4-2-2005 12:15, Matthias Fraass wrote:
>>Try
>> request.getHeader("referer");
>>
>>Matthias

>
> Shouldn't that be
> request.getHeader("Referer");
> AFAIK, header names are case-sensitive, including the HTTP Referer header.


The API-Doc[1] says "The header name is case insensitive." - maybe there
is some toLowerCase() in the implementation.
I also checked it in a debugger and it worked.

Matthias

[1] http://tinyurl.com/5ggjt
 
Reply With Quote
 
Roland
Guest
Posts: n/a
 
      02-04-2005
On 4-2-2005 17:15, Matthias Fraass wrote:
> Roland wrote:
>
>> On 4-2-2005 12:15, Matthias Fraass wrote:
>>
>>> Try
>>> request.getHeader("referer");
>>>
>>> Matthias

>>
>>
>> Shouldn't that be
>> request.getHeader("Referer");
>> AFAIK, header names are case-sensitive, including the HTTP Referer
>> header.

>
>
> The API-Doc[1] says "The header name is case insensitive." - maybe there
> is some toLowerCase() in the implementation.
> I also checked it in a debugger and it worked.
>
> Matthias
>
> [1] http://tinyurl.com/5ggjt

Yeah, you're right. I stand corrected.
--
Regards,

Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[JSP] difference between jsp:forward and jsp:include alexjaquet@gmail.com Java 0 06-02-2006 01:21 PM
How to get the html output of a local JSP page from my Java code, or use a JSP as an HTML templates. DigitalUncle Java 0 11-02-2004 05:22 PM
Grabbing referrer page on a redirected error page darrel ASP .Net 4 09-29-2004 08:25 PM
Re: Get referrer URL Harley ASP .Net 0 07-26-2003 04:00 AM
Get referrer URL Harley ASP .Net 0 07-24-2003 06:07 AM



Advertisments