How to get referrer page with in JSP

Discussion in 'Java' started by Steven, Feb 4, 2005.

  1. Steven

    Steven Guest

    Steven, Feb 4, 2005
    #1
    1. Advertising

  2. 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
    Matthias Fraass, Feb 4, 2005
    #2
    1. Advertising

  3. Steven

    Roland Guest

    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_/ /__/
    / \ /_/ / \
    Roland, Feb 4, 2005
    #3
  4. 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
    Matthias Fraass, Feb 4, 2005
    #4
  5. Steven

    Roland Guest

    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_/ /__/
    / \ /_/ / \
    Roland, Feb 4, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harley

    Get referrer URL

    Harley, Jul 24, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,033
    Harley
    Jul 24, 2003
  2. Harley

    Re: Get referrer URL

    Harley, Jul 26, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    3,301
    Harley
    Jul 26, 2003
  3. darrel
    Replies:
    4
    Views:
    773
    darrel
    Sep 29, 2004
  4. =?Utf-8?B?U3RlcGhhbmU=?=

    Asp.net page request has not referrer?

    =?Utf-8?B?U3RlcGhhbmU=?=, Oct 21, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    6,446
    =?Utf-8?B?U3RlcGhhbmU=?=
    Oct 21, 2004
  5. DigitalUncle
    Replies:
    0
    Views:
    899
    DigitalUncle
    Nov 2, 2004
Loading...

Share This Page