カスタム Authenticator があり、 seam 3 で認証に成功した後、ホームページにリダイレクトしたいと考えています。どうやってやるの ??
1683 次
2 に答える
1
これを行うにはいくつかの方法があります。
最も簡単な方法はreturn "/home.xhtml";
、ログイン アクションで行うことです。
于 2011-05-11T07:06:48.097 に答える
1
他の方法は、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>
于 2011-05-11T11:49:06.073 に答える