setting ip & referer in tomcat

Discussion in 'Java' started by Amir Michail, Dec 23, 2006.

  1. Amir  Michail

    Amir Michail Guest

    Hi,

    Is there an easy way to set arbitrary ips and referers on-the-fly as
    the app runs in tomcat?

    This is information that would be obtained by the servlet using
    HttpServletRequest.getHeader(..).

    Amir
    Amir Michail, Dec 23, 2006
    #1
    1. Advertising

  2. Amir Michail wrote:
    > Is there an easy way to set arbitrary ips and referers on-the-fly as
    > the app runs in tomcat?
    >
    > This is information that would be obtained by the servlet using
    > HttpServletRequest.getHeader(..).


    Referrer is set by the browser and read by the server.

    What do you really want to do ?

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

  3. Amir  Michail

    Amir Michail Guest

    Arne Vajhøj wrote:
    > Amir Michail wrote:
    > > Is there an easy way to set arbitrary ips and referers on-the-fly as
    > > the app runs in tomcat?
    > >
    > > This is information that would be obtained by the servlet using
    > > HttpServletRequest.getHeader(..).

    >
    > Referrer is set by the browser and read by the server.
    >
    > What do you really want to do ?
    >
    > Arne


    I would like to set up a convenient environment for development of a
    web app that makes use of this information without actually having to
    use different IPs to do the testing. While testing the application, I
    would like to be able to change on-the-fly what
    HttpServletRequest.getHeader(..) returns.

    Amir
    Amir Michail, Dec 23, 2006
    #3
  4. Amir Michail wrote:
    > Arne Vajhøj wrote:
    >> Amir Michail wrote:
    >>> Is there an easy way to set arbitrary ips and referers on-the-fly as
    >>> the app runs in tomcat?
    >>>
    >>> This is information that would be obtained by the servlet using
    >>> HttpServletRequest.getHeader(..).

    >> Referrer is set by the browser and read by the server.
    >>
    >> What do you really want to do ?

    >
    > I would like to set up a convenient environment for development of a
    > web app that makes use of this information without actually having to
    > use different IPs to do the testing. While testing the application, I
    > would like to be able to change on-the-fly what
    > HttpServletRequest.getHeader(..) returns.


    Set the header in your client test code then.

    URLConnection has a setRequestProperty method that can
    do such things.

    Whatever you are using on top of that for testing may
    have equivalent capability.

    Arne
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Dec 23, 2006
    #4
    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. dave wanta

    Re: How to Spoof Referer URL

    dave wanta, Jul 6, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,029
    Admin
    Jul 7, 2003
  2. =?Utf-8?B?TWlsYW4gTmVnb3Zhbg==?=

    How do I clear the "Referer" header?

    =?Utf-8?B?TWlsYW4gTmVnb3Zhbg==?=, Aug 18, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    757
    clintonG
    Aug 19, 2004
  3. Kevin Spencer

    No referer page for SWF files

    Kevin Spencer, Oct 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    548
    Raed Sawalha
    Oct 28, 2004
  4. CJ
    Replies:
    1
    Views:
    1,564
    Andrew Thompson
    Oct 29, 2004
  5. samwyse
    Replies:
    3
    Views:
    2,074
Loading...

Share This Page