private Map<String,Object> session;
1.通过ActionContext来获取Session对象
session = ActionContext.getContext().getSession();
2.将用户名保存Session作用域中去
session.put("user", name);
本文出自 “素颜” 博客,请务必保留此出处http://suyanzhu.blog.51cto.com/8050189/1563147
原文地址:http://suyanzhu.blog.51cto.com/8050189/1563147