您的位置:首頁技術文章
文章詳情頁

JSF中用戶登出返回登錄頁面問題

瀏覽:79日期:2024-05-31 17:45:33

在頁面中使用

<h:commandLink value="[#{msg.logout}]" action="#myBean.logout}"></h:commandLink>

做登出操作的時候,代碼如下:

public String logoutHMS() {

String outCome ="logoutSuccess";

System.out.print("Logout!!);

// 設置登錄Session關鍵信息

FacesContext fc = FacesContext.getCurrentInstance();

HttpSession Session = (HttpSession) fc.getExternalContext()

.getSession(false);

Session.invalidate();

return outCome;

}

不能使用actionListener屬性,否則退出了,重載不了登錄頁面。

標簽: JavaScript
相關文章:
国产综合久久一区二区三区