在页面中使用
<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属性
,否则退出了,重载不了登录页面
。
希望这篇
JSF的中用户登出返回登录页面问题的文章能够对您有所帮助,如果您觉得这篇网站维护教程有用的话,别忘了推荐给您的朋友哦!如果您有好的经验方法,不妨拿出来和大家一起分享:假如每个人都拿出一个经验,那么我们都将额外的获取一堆他人的经验。
请记住本站永久域名:(黑客防线网安服务器维护方案维护基地)Www.Rongsen.Com.Cn