top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

How do you find out what client machine is making a request to your servlet ?

+3 votes
104 views
How do you find out what client machine is making a request to your servlet ?
posted Feb 13, 2015 by Dominic

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

The ServletRequest class has functions for finding out the IP address or host name of the client machine. getRemoteAddr() gets the IP address of the client machine and getRemoteHost() gets the host name of the client machine.

Getting a client’s address and hostname requires that you:

Get clients ip adfress using HttpServletRequest.getRemoteAddr().
Get clients hostname using HttpServletRequest.getRemoteHost().
answer Feb 16, 2015 by Karthick.c
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...