request获取真实IP
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;
}