I have the following navigation case in my faces-config.xml:
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>CadastroAutorizado</from-outcome><to-view-id>/paginas/cadastro/clientes/cadastroAutorizado.jsf</to-view-id>
</navigation-case>
</navigation-rule>
In some buttons i want to call an actionListener that do some validations and then call a method that programmatically redirects to some page, using this method:
FacesContext.getCurrentInstance().getExternalContext().redirect("CadastroAutorizado");
What i want is to redirect to the page configured in the navigation case:
/paginas/cadastro/clientes/cadastroAutorizado.jsf
How to do it?
-----------EDIT-----------
This is the button where i call the actionListener that reirects:
<p:commandButton id="botaoRetornar" global="false" value="Retornar" update="formPrincipalTemplate" actionListener="#{mbName['acaoRetornar']}" />
In the method, i want to execute some validations, and in case that validation fails, it must stay in the same page and show a message using primefaces growl component. How can i do it using the action attribute instead of actionListener?