This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes request.getRemoteAddr() not returning correct value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "request.getRemoteAddr() not returning correct value" Watch "request.getRemoteAddr() not returning correct value" New topic
Author

request.getRemoteAddr() not returning correct value

Boby sharma
Greenhorn

Joined: Oct 07, 2010
Posts: 1
Hello,

we are facing a issue which i describe below.

we have our application previously on Tomcat 6.0.32 which has to be migrated to JOnAS 5.2.1 server.

we are also using Apache HTTP 2.2 as a proxy server between Tomcat and application every request goes to Apache HTTP 2.2 server first then it redirect to the our local environment.So as the request is

coming from Apache HTTP 2.2 the method request.getRemoteAddr() returns the IP Address of the server where Apache HTTP 2.2 is installed.

But as we have migrated our application from Tomcat to JOnAS,the same line in one of the filter request.getRemoteAddr() is returning IP address of our local development machine where JOnAS is running.

---->Earlier in Tomcat we used to set path of our application in server.xml of tomcat.

<Context path="/oscar" reloadable="true" docBase="D:\Projects\Oscar\Integration\sources\projects\Oscar\WebContent" workDir="D:\Projects\Oscar\Integration\sources\projects\Oscar\WebContent\work\org\apache\jsp" >

But in JOnAS we are deploying WAR due to problem in loading from context.

I am really unable to understand the problem.

Thanks for your support.

Regards,
KSH
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960
    
  19

Welcome to the JavaRanch, Boby!

What benefits are you hoping to achieve using getRemoteAddr(). It's actually fairly useless. For example, every machine on my LAN would appear to your server under the same IP address.

The JOnAS webapp server runs an embedded copy of Tomcat, but because JOnAS is a full-stack implementation, it has to deal with EARs and other non-WAR deployables as well as WARs themselves. So its deployment processes are different from stand-alone Tomcat.

Fortunately, the JOnAS documentation is generally fairly good, and the people on the JOnAS project were always very helpful to me, so I always enjoyed working with JOnAS.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: request.getRemoteAddr() not returning correct value
 
Similar Threads
Problems geting the request sender IP address
request.getRemoteAddr() 127.0.0.1 ?
apache (tomcat) not parsing XML file?
Http session is getting lost in Websphere when proxy sever is used
Memory issue with Jonas Server while deploying a war.