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 Determining client ip in servlet? 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 "Determining client ip in servlet?" Watch "Determining client ip in servlet?" New topic
Author

Determining client ip in servlet?

Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
Wondering if it's possible to determing the ip address of the client inside one of my servlets. I've used the HttpServletRequest.getHeader("user-agent") to find out the browser and OS. I'd like to do the same for ip.
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Michael,
Did you try this API?.
From Servlet API Doc :

regds
maha anna
[This message has been edited by maha anna (edited February 06, 2001).]
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
Thanks Maha, I was looking in the wrong place as I was assuming it was in the header.
 
Don't get me started about those stupid light bulbs.
 
subject: Determining client ip in servlet?
 
Similar Threads
How to get client's IP address, Domain using Java
Getiing Server IP address
trying to connect to another ip adress
how to get the client's bowser URL who's hitting your service from ajax call?
Tomcat HttpSession inactivity