tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Williamson" <ja...@nameonthe.net>
Subject Re: Help me: URGENT!!!
Date Sat, 04 May 2002 16:36:36 GMT
Laura,

>From what I understand you want the IP address of the referrer,
why not use HttpServletRequest's getHeader method to get
the 'referer' header that the browser has hopefully sent (not all
do). Be careful with the spelling of referrer, it's spelt (incorrectly)
referer when the browser sends it.
The alternative is to send an extra parameter in the url.

Regards,

James Williamson
www.nameonthe.net
UK Tomcat Hosting

----- Original Message -----
From: Laura <lauradiara@libero.it>
To: Tomcat Users List <tomcat-user@jakarta.apache.org>; Anton Schoultz
<ASchoultz@RUBICO.COM>
Sent: Friday, May 03, 2002 11:32 AM
Subject: Re: Help me: URGENT!!!


> But I dont't want my IP.
>
> I presume that .getLocalHost() in my servlet gives me my IP.
>
> I want the Ip address of the requesting server (and not my IP or IP cost
> client = user).
>
> Thanks
>
> Laura
>
> Alle 12:03, venerdì 3 maggio 2002, Anton Schoultz ha scritto:
> > Hi Laura,
> >
> > Have a look at the class java.net.InetAddress,
> > it has a method .getLocalHost() which returns
> > the local host's IP address.
> >
> > Kindest Regards
> >
> > Anton Schoultz
> >
> > Rubico (Pty) Ltd
> > Cell Phone:  +27 83 651 7191
> > Tel:  +27 (11) 808 1000
> > Fax:  +27 (11) 808 1101
> > mailto:aschoultz@Rubico.com
> > www.Rubico.com
> >
> > The Business Component Company
> >
> >
> > -----Original Message-----
> > From: Laura [mailto:lauradiara@libero.it]
> > Sent: Fri 03 May 2002 11:18
> > To: tomcat-user@jakarta.apache.org
> > Subject: Help me: URGENT!!!
> >
> >
> > Hi all,
> >
> > please help me!! I'll explain you my problem.
> >
> > I have a servlet which has to recognize two ip addresses. If the servlet
> > finds that the request is from the IP1 (server1), it sets a shop login
> > variable to xxxxx, else if the request IP is IP2 (server2) it sets the
shop
> > login to yyyy.
> > The problem is this: the ecommerce page is on a machine 1 while the pay
> > gateway is on the machine2 (my servlets).
> > The user buys something on the machine 1 and when he has to pay he is
> > redirected to my servlet on machine 2.
> >
> > I use this instructions for distinguishing the request IP:
> >
> > String senderIP = request.getRemoteAddr();
> >
> > BUT THIS IS THE HOST IP AND NOT THE IP OF MY SERVER (server1 or server2
> > with
> >
> > two shop login different).
> >
> > How can I know the request ip of my server?
> >
> >
> > Please help me!!!!!
> >
> >
> > Thanks for your help
> >
> >
> > Laura
>
> --
> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message