如何获得客户端的IP地址

在action中如何获得客户端的ip:首先要获得request对象;

HttpServletRequest request=ServletActionContext.getRequest();
   System.out.println(request.getRemoteAddr());

你可能感兴趣的:(action)