http://blog.csdn.net/finelife/article/details/1608632
1.写入session
Object sessionName = "name";
Object sessionValue = "value";
HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(true);
session.setAttribute(sessionName,sessionValue);
2.获取session值
String getName = session.getAttribute("name").toString();
3.清除session
session.invalidate();
JSF session的用法
时间: 2024-11-08 07:00:31