获取完整IP地址

1      public void getIpAddr(HttpServletRequest request,Log log) {
2            log.info( ">>>>>>>>>>获取请求方IP地址开始>>>>>>>>>>" );
3            log.info( "RemoteAddr:"+request.getRemoteAddr());
4            log.info( "HTTP_CLIENT_IP:"+request.getHeader("HTTP_CLIENT_IP" ));
5            log.info( "WL-Proxy-Client-IP:"+request.getHeader("WL-Proxy-Client-IP" ));
6            log.info( "Proxy-Client-IP:"+request.getHeader("Proxy-Client-IP" ));
7            log.info( "x-forwarded-for:"+request.getHeader("x-forwarded-for" ));
8            log.info( ">>>>>>>>>>获取请求方IP地址结束>>>>>>>>>>" );
9      }

 

posted @ 2013-03-02 13:52  为牛马者,背负前行  阅读(374)  评论(0编辑  收藏  举报

如果本页面列出的内容侵犯了您的权益,请告知。
知识共享许可协议
996.icu