How can we access the HttpServletRequest
You can obtain the request by asking the ActionContext or implementing ServletRequestAware. Implementing ServletRequestAware is preferred. 获得request可以通过请求 ActionContext 和继承 ServletRequestAware。优先 继承 ServletRequestAware 1、 请求 ActionContext HttpServletRequest request = ServletActionContext.getRequest(); 2、 继承 ServletRequestAware (1)Ensure that servlet-config Interceptor is included in the Action's stack. The default stack already includes servlet-config . (2)Edit the Action so that it implements the ServletRequestAware interface. The ServletRequestAware interface expects a setServletRequest