• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get client machine IP address  RSS feed

 
Vipsha Sharma
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one web application where I need to capture the IP addresses of the users(clients) accessing it.

Can any one help me to do the same.

Thanks in advance.
 
Rob Spoor
Sheriff
Posts: 21133
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletRequest (and therefore also HttpServletRequest) has a method called getRemoteAddr(), which "returns the Internet Protocol (IP) address of the client or last proxy that sent the request. For HTTP servlets, same as the value of the CGI variable REMOTE_ADDR."
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!