This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes HttpServletRequest getRemoteAddr() has strange results Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HttpServletRequest getRemoteAddr() has strange results" Watch "HttpServletRequest getRemoteAddr() has strange results" New topic
Author

HttpServletRequest getRemoteAddr() has strange results

Mike Firkser
Ranch Hand

Joined: Oct 21, 2003
Posts: 247

I have the development environment for a J2EE web app on my machine. On the login servlet I have a call to get the IP of the user using . Using the Chrome Browser, I have no problem, it returns a nice IP Address. However, using IE, Firefox, or Safari, I get a value like this: fe80:0:0:0:80f1:b54b:7e02:e24 - This only happens when I access the app from my local machine. A co-worker tried to access the application on my machine, and it worked fine, but he had the same problem in his own environment.

Has anybody seen anything like this. This is causing problems because without this particular part of code working, I can't test in IE, Firefox, or Safari, only Chrome.

Any assistance would be appreciated.

Thanks in advance for any help.

Mike


Mike Firkser
Rutgers '84
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
That's an IP6 address, whereas the "nice looking" one is likely an IP4 address.
Mike Firkser
Ranch Hand

Joined: Oct 21, 2003
Posts: 247

Thanks.

It looks like we'll need to change our database to accept the larger IP values. Oh, the cost of progress.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: HttpServletRequest getRemoteAddr() has strange results
 
Similar Threads
document.location context jumbled up in Chrome and Safari using Struts mappings ?
Problems with Charset
On propertychange issues with text value
why google chrome sucks
KeyListener failing for Macs