标签:
/**
* 获取真实的IP地址
*
* @return
*/
public String getRemoteIP() {
String ip = request.getRemoteAddr();
if (request.getHeader("x-forwarded-for") != null
&& !"unknown".equalsIgnoreCase(request
.getHeader("x-forwarded-for"))) {
ip = ip + "," + request.getHeader("x-forwarded-for");
}
return ip;
}
标签:
原文地址:http://www.cnblogs.com/king-/p/5009653.html