import org.apache.struts2.ServletActionContext; //得到用户IP地址 String ip = ServletActionContext.getRequest().getRemoteAddr();