getting a referring url?

Discussion in 'Java' started by tiewknvc9, Sep 11, 2006.

  1. tiewknvc9

    tiewknvc9 Guest

    Hi!

    Im simply trying to do a security check by ensuring that the user
    accessed my servlet from within my domain. (yes I know, it is a poor
    choice, but I have others in place, and feel that every little bit
    helps).

    So... how can I retrieve the referring url?

    I assume it would be part of the request... but I know little of
    servlets, and am just finalizing some functionality.

    THanks!!!
     
    tiewknvc9, Sep 11, 2006
    #1
    1. Advertising

  2. tiewknvc9 wrote:
    > Im simply trying to do a security check by ensuring that the user
    > accessed my servlet from within my domain. (yes I know, it is a poor
    > choice, but I have others in place, and feel that every little bit
    > helps).
    >
    > So... how can I retrieve the referring url?
    >
    > I assume it would be part of the request... but I know little of
    > servlets, and am just finalizing some functionality.


    Try:

    request.getHeader("referrer")

    Arne
     
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Sep 11, 2006
    #2
    1. Advertising

  3. tiewknvc9

    Rogan Dawes Guest

    Arne Vajhøj wrote:
    > tiewknvc9 wrote:
    >> Im simply trying to do a security check by ensuring that the user
    >> accessed my servlet from within my domain. (yes I know, it is a poor
    >> choice, but I have others in place, and feel that every little bit
    >> helps).
    >>
    >> So... how can I retrieve the referring url?
    >>
    >> I assume it would be part of the request... but I know little of
    >> servlets, and am just finalizing some functionality.

    >
    > Try:
    >
    > request.getHeader("referrer")
    >
    > Arne


    You have spelled that correctly, but it is incorrect! ;-)

    request.getHeader("referer")

    The folks that wrote the RFC spelled it incorrectly, and now it is cast
    in stone . . . .

    Rogan
     
    Rogan Dawes, Sep 11, 2006
    #3
    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. George

    Referring URL\VB

    George, Feb 9, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    7,483
    George
    Feb 9, 2004
  2. BernieH

    Referring URL

    BernieH, Aug 9, 2005, in forum: HTML
    Replies:
    1
    Views:
    554
    Safalra
    Aug 9, 2005
  3. paladin

    Missing Referring URL in log files

    paladin, Jan 10, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    538
    paladin
    Jan 11, 2007
  4. slamar
    Replies:
    0
    Views:
    883
    slamar
    Aug 17, 2011
  5. Chumley the Walrus

    Checking to see if a referring url/link matches

    Chumley the Walrus, Jul 1, 2004, in forum: ASP General
    Replies:
    4
    Views:
    141
    Steven Burn
    Jul 1, 2004
Loading...

Share This Page