没事来灌个水。。
本帖最后由 岚涯蝶影 于 2012-8-2 01:58 编辑public String getIpAddr(HttpServletRequest request) {
String strClientIp = request.getHeader("x-forwarded-for");
log.info("All the IP address string is: " + strClientIp);
if(strClientIp == null || strClientIp.length() == 0 ||"unknown".equalsIgnoreCase(strClientIp))
{
strClientIp = request.getRemoteAddr();
}else{
StringList ipList = new StringList();
BusiAcceptAction.SplitsString(strClientIp, ',' , ipList);
String strIp = new String();
for(int index = 0; index < ipList.size(); index ++)
{
strIp = (String)ipList.get(index);
if(!("unknown".equalsIgnoreCase(strIp)))
{
strClientIp = strIp;
break;
}
}
}
return strClientIp;
} 这是什么东东:o 回复 2# chentianlong
爪哇语:lol 这是什么东西啊 回复 4# 离别无心
没啥,灌水而已。。。 俄,无语,浪费我表情 话说我什么时候用户组升到文艺青年了
页:
[1]