我必须使用我的公司登录资源,如何将注销servlet设置为我的primefaces组件?
如何“翻译”这个......
//in a jsp page:
<a href="<%=request.getContextPath()%>/servlet/com.app.ServletEndSession?initialPage=/index.jsp" > Logout </a>
......进入这个:
<p:commandButton type="button" value="Logout" action="??" />
提前致谢。
答案 0 :(得分:1)
您的<a/>
应该成为
<p:button href="#{facesContext.externalContext.requestContextPath}/servlet/com.app.ServletEndSession?initialPage=/index.jsp" value="Dialogit"/>
答案 1 :(得分:0)
您可以在commandButton上使用托管bean,然后在您的页面中进行重定向? 因为你肯定想用p:commandbutton离开,你想要设置ajax =&#34; false&#34;采取行动。
或者你可以使用
<p:commandButton type="button" value="logout" onclick="javascriptTolinkToServletEndEsssion" />