permaculture playing cards*
The moose likes Servlets and the fly likes IP Address 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 "IP Address" Watch "IP Address" New topic
Author

IP Address

Samuel Lugo
Greenhorn

Joined: Feb 28, 2005
Posts: 24
Hello,
Does anyone know how to get the IP address of the client hitting a servlet/JSP? Thanks for the help.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Look through HttpServletRequest for getRemote... and see if any will do the job.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Samuel Lugo
Greenhorn

Joined: Feb 28, 2005
Posts: 24
Yep, request.getRemoteAddr(). Thanks a bunch.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Nice work Stan
 
jQuery in Action, 2nd edition
 
subject: IP Address
 
Similar Threads
Unknown Host Exception
SQL Server 2005 Connection using SQL Explorer 3.5 in Eclipse
Login in same user at the same time in different machine
Geo Blocking
public JDBC