public String logout() { ((HttpSession) FacesContext.getCurrentInstance().getExternalContext() .getSession()).invalidate(); return "homePage"; } 和<h:commandLink value="#{msg.logout}" action="#{logoutBean.logout}" />
FacesContext.getCurrentInstance().getExternalContext().invalidateSession()
- Panu Haaramo