当前位置: 代码迷 >> Web前端 >> SSH怎么创建,获取session,获取paramater值
  详细解决方案

SSH怎么创建,获取session,获取paramater值

热度:91   发布时间:2012-10-27 10:42:26.0
SSH如何创建,获取session,获取paramater值
创建session:
ActionContext actionContext = ActionContext.getContext();
Map<String, Object> session = actionContext.getSession();

给创建的session存入值:
session.put(StaticUtil.USERPKID, userInfo.getPkid());

获取session值:
ActionContext ac = ActionContext.getContext();
Map<String, Object> session = ac.getSession();
Integer receiveUserID = (Integer) session.get(sessionValue);

( 或ServletActionContext.getRequest().getSession().getAttribute(sessionValue); )

Struts2获取paramater值:
ServletActionContext.getRequest().getParameter("...");
  相关解决方案