-4
在一个项目中所涉及的技术是JEE,primefaces的数量,休眠和JSF(与jsfhelper),我们有以下代码:如何显示活动会话
public static SessionBean getSessionBean() {
SessionBean sessionBean = (SessionBean) JsfHelper.getSessionAttribute("SessionBean");
if (sessionBean == null) {
sessionBean = new SessionBean();
JsfHelper.setSessionAttribute("SessionBean", sessionBean);
}
return sessionBean;
}
Student student = new Student();
public String login() throws Exception {
Student studentLogin = studentDao.login(student.getUsername(), student.getPassword());
if (studentLogin.getUsername() != null) {
JsfHelper.getSessionBean().setStudent(studentLogin);
return "dashboard";
} else {
return null;
}
}
我如何能显示数字或在线用户的名字?