获得request等对象
通过ServletActionContext获得
HttpServletRequest request = ServletActionContext.getRequest();
另一种方法,通过实现相关接口,依赖注入获得
public class ParamGet extends AbstractInterceptor implements ServletRequestAware, ServletResponseAware, ServletContextAware { public HttpServletRequest servletRequest; public ServletContext servletContext; public HttpServletResponse servletResponse; }
原文地址:https://www.cnblogs.com/suheng/p/9222568.html
时间: 2024-10-24 15:16:45