热门

最新

红包

立Flag

投票

同城

我的

发布
qq_44472728
“孤酒”
5 年前
trueqq_44472728

上班中,逛CSDN中

上班摸鱼
CSDN App 扫码分享
分享
评论
2
打赏
  • 复制链接
  • 举报
下一条:
public static String getIpAddr(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.getRemoteAddr(); } return ip; }
立即登录