获取完整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      }

 

你可能感兴趣的:(IP地址)