java吧 关注:1,254,798贴子:12,744,944
  • 0回复贴,共1

ActionContext.getContext().getSession()遇到的问题

只看楼主收藏回复

我在LoginAction中设置了ActionContext.getContext().getSession().put("user", getName());但是在GetAction中ActionContext.getContext().getSession().get("user");取数据的时候返回的是Null
///////////////////////////////////////
之后在LoginAction里改成了ActionContext act = ActionContext.getContext(); act.getSession().put("user", getName());在GetAction中改成ActionContext act = ActionContext.getContext();String user = (String)act.getSession().get("user");就没问题了,求指点


IP属地:江苏1楼2011-11-29 00:46回复