Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Determining client ip in servlet?

 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Maha, I was looking in the wrong place as I was assuming it was in the header.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic