1 String ip = request.getHeader("x-forwarded-for"); 2 if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { 3 ip = request.getHeader("Proxy-Client-IP"); 4 } 5 if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { 6 ip = request.getHeader("WL-Proxy-Client-IP"); 7 } 8 if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { 9 ip = request.getRemoteAddr(); 10 } 11 System.out.println("ip:"+ip);