JAVA获取访问用户的客户端IP(适用于公网与局域网)
/** * 获取访问用户的客户端IP(适用于公网与局域网). */ public static final String getIpAddr(final HttpServletRequest request) throws Exception { if (request == null) { throw (new Exception("getIpAddr method HttpServletRequest Object is null")); } String ipString = request.getHeader("x-forwarded-for"