通过ServletActionContext.类直接获取:
public String rsa() throws Exception{
HttpServletRequest request = ServletActionContext.getRequest();
ServletContext servletContext = ServletActionContext.getServletContext();
HttpSession session = request.getSession() ;
HttpServletResponse response = ServletActionContext.getResponse();
return "scope";
}
本文详细介绍了如何使用ServletActionContext类直接获取HttpServletRequest、ServletContext、HttpSession和HttpServletResponse等关键对象,并返回作用域字符串。
212

被折叠的 条评论
为什么被折叠?



