Redirect to home page after login seam 3
I have custom Authenticator and I want to redirect to home page after successfully authenticate in seam开发者_StackOverflow社区 3 . How can i do that ??
There are a few ways to do this.
The simplest way is to return "/home.xhtml";
in your login action.
Other way is use navigation rule in faces-config.xml:
<navigation-rule>
<from-view-id>/loginPage.xhtml</from-view-id>
<navigation-case>
<from-action>#{authBean.login}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>/homePage.xhtml</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-action>#{authBean.login}</from-action>
<from-outcome>fail</from-outcome>
<to-view-id>/loginPage.xhtml</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
精彩评论