如何在struts 中获得request respones session

构架基类  action 继承基类

public class BaseAction implements ServletRequestAware,ServletResponseAware,SessionAware,ServletContextAware {
protected Map<String, Object> session;
protected transient HttpServletRequest request;
protected transient HttpServletResponse response;    
    protected transient ServletContext context;
    
public void setServletRequest(HttpServletRequest request) {
this.request = request;
}
public void setServletResponse(HttpServletResponse response) {
this.response = response;
}
public void setSession(Map<String, Object> session) {
this.session = session;
}
public void setServletContext(ServletContext context) {
this.context = context;
}
}

 

posted @ 2013-09-28 00:26  roscee  阅读(176)  评论(0编辑  收藏  举报