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

Technology CommunityCategory: JavaHow do you find out what client machine is making a request to your servlet?
VietMX Staff asked 3 years ago

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. See example here.