Try this one,
String ipAddress = request.getHeader("X-FORWARDED-FOR");
if (ipAddress == null) {
ipAddress = request.getRemoteAddr();
}
reference : http://www.mkyong.com/java/how-to-get-client-ip-address-in-java/
Try this one,
String ipAddress = request.getHeader("X-FORWARDED-FOR");
if (ipAddress == null) {
ipAddress = request.getRemoteAddr();
}
reference : http://www.mkyong.com/java/how-to-get-client-ip-address-in-java/