java web判断服务器是否是本机
1,如何获取浏览器的ip Java代码 /*** * 获取客户端ip地址(可以穿透代理) * @param request * @return */ public static String getClientIpAddr(HttpServletRequest request) { String ip = request.getHeader( "X-Forwarded-For" ); if (ip == null || ip.length() == 0 || "unknown" .equalsIgnoreCase(ip)) { ip = request.getHeader( "Proxy-Client-IP" ); } if (ip == null || ip.length() == 0 || "unknown" .equalsIgnoreCase(ip)) { ip = request.getHeader( "WL-Proxy-Client-IP" ); } if (ip == null || ip.length() == 0 || "unknown" .equalsIgnoreCase(ip)) { ip = request.getHeader( "HTTP_X_FORWARDED_FOR" ); } if (ip == null || ip.length() == 0 ||