Struts 数据处理

来源:互联网 发布:安徽渠道网络怎么样 编辑:程序博客网 时间:2024/06/06 12:46

方式一:直接获取servletAPI

核心类:ServletActionContext中的静态方法

HttpServletRequest request = ServletActionContext.getRequest();HttpServletResponse response = ServletActionContext.getResponse();

方式二:通过ActionContext类获取不同的Map

ActionContext ac = ActionContext.getContext();Map<String, Object> session = ac.getSession();Map<String, Object> application = ac.getApplication();Map<String, Object> request = ac.getContextMap();

方式三:通过实现接口的方法

RequestAwareSessionAwareApplicationAware
0 0
原创粉丝点击