Boa tarde!
Estou com problema com a tag h:commandLink abaixo:
<html>
<h:commandLink id="btnSair" action="Login.sair" disabled="false" title="Sair">
<button>
<img src="#{facesContext.externalContext.requestContextPath}/resources/images/sair_50.png" />
</button>
</h:commandLink>
</html>
na sua propriedade action deveria passar no método sair do meu MB Login, mas ele não entra. Coloquei um System.out.println pra ver se passava dentro do método e não faz.
Procurei na documentação da tag que garante que passa no método do BackBean,
alguém pode me ajudar?
Pode postar o componente inteiro?
segue tag
h:commandLink id=“btnSair” action=“Login.caralho” disabled=“false” title=“Sair” value=“Sair"
button
img src=”#{facesContext.externalContext.requestContextPath}/resources/images/sair_50.png" /
/button
/h:commandLink
DEIXEI SEM OS “<>” porque não estava mostrando a tag
deveria entrar neste metodo desta classe
@ManagedBean (name=“Login”)
@RequestScoped
public class Login {
public String sair() throws ServiceException {
System.out.println("login sair");
FacesContext fc = FacesContext.getCurrentInstance();
fc.getExternalContext().getSessionMap().remove("SessionBean");
HttpSession session = (HttpSession)fc.getExternalContext().getSession(true);
session.removeAttribute("sessionUser");
session.invalidate();
getSessionBean().setSecurity(null);
return "Login";
}
}
“<h:commandLink id=“btnSair” action=“Login.caralho” disabled=“false” title=“Sair” value=“Sair”> </h:commandLink>”
gustavodefreitasmene:
action=“Login.sair”
acredito que o erro esteja aqui:
troque (action=“Login.sair) por action=”#{Login.sair}"