struts2获取servlet的api

2021-02-09 06:19

阅读:507

标签:struts2获取servlet的api

public class Demo1Action extends ActionSupport {
public String execute(){
ServletContext application = ServletActionContext.getServletContext();
HttpServletRequest request = ServletActionContext.getRequest();
HttpServletResponse response = ServletActionContext.getResponse(); HttpSession session = request.getSession();
System.out.println(application);
System.out.println(session);
System.out.println(request);
System.out.println(response);
return SUCCESS;
}
}

struts2获取servlet的api

标签:struts2获取servlet的api

原文地址:http://blog.51cto.com/13579086/2086396


评论


亲,登录后才可以留言!