1
Good night
I have the following problem, I have a JSF application and I need to do a logoff command, I did several and all gave the same result, it "kills" the user’s session (logs in), but does not redirect to login screen (which is screen I want it back) good here are the codes:
This is the Managebean:
public String logoff() {
FacesContext fc = FacesContext.getCurrentInstance();
HttpSession session = (HttpSession)fc.getExternalContext().getSession(false);
session.invalidate();
return "/pages/public/index.xhtml";
}
And here’s the XHTML commandLink:
<p:commandLink id="logoff" value="Teste"
actionListener="#{autenticacaoManageBean.logoff}" ajax="false" />
The login screen and the screen that this logoff button are in separate folders
the login is on pages/public/login.xhtml
the button is on pages/templates/header.xhtml
Thanks for your help.
valeu brother, it worked out here, thank you very much.
– Marcos André Machado da Silva