String clientIp = request.getHeader("HTTP_X_FORWARDED_FOR");
if(null == clientIp || clientIp.lenght() == 0
|| clientIp.toLowerCase().equals("unknown")){
clientIp = request.getHeader("REMOTE_ADDR");
}
if(null == clientIp || clientIp.lenght() == 0
|| clientIp.toLowerCase().equals("unknown")){
clientIP = request.getRemoteAddr();
}