We can get client IP address from Request
object as follows:
String ipAddress = request.getRemoteAddr();
But, if the user is behind a proxy server or access your web server through a load balancer, the above code will get the IP address of the proxy server or load balancer server, not the original IP address of a client.