读书人

BaseAction惯用方法封装

发布时间: 2012-08-22 09:50:35 作者: rapoo

BaseAction常用方法封装

public class BaseAction extends ActionSupport{private static final long serialVersionUID = 1348913248;public Map<String, Object> getSession(){return ActionContext.getContext().getSession();}public Map<String, Object> getContextMap(){return ActionContext.getContext().getContextMap();}public Map<String, Object> getParamMap(){return ActionContext.getContext().getParameters();}public ActionContext getContext(){return ActionContext.getContext();}public void putInSession(String key, Object value){this.getSession().put(key, value);}public void putInContext(String key, Object value){this.getContextMap().put(key, value);}}

读书人网 >编程

热点推荐