标签:style class blog code java http
/*** * 获取客户端IP * @param request * @return */ public static String getIpAddrByRequest(HttpServletRequest request) { String ip=null; if(request.getHeader("x-real-ip") == null) { ip = request.getRemoteAddr(); } else { ip = request.getHeader("x-real-ip"); } return ip; }
标签:style class blog code java http
原文地址:http://www.cnblogs.com/W203654/p/3772715.html