-1
我知道 可以在faces-config.xml文件中設置導航規則。但在那裏,我只知道選擇以正確的流程進行導航。JSF中的導航規則
但我想避免未登錄的用戶在地址欄中輸入網址時直接進入主屏幕。 有沒有可能在配置文件中做到這一點,或者我必須寫一個Frontcontroller作爲一個類?
我的代碼:
<navigation-rule>
<from-view-id>/login.xhtml</from-view-id>
<navigation-case>
<from-outcome>register</from-outcome>
<to-view-id>/register.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>succes</from-outcome>
<to-view-id>/home.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>fail</from-outcome>
<to-view-id>/login.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
希望你能幫助我。
檢查:http://stackoverflow.com/questions/10154202/how-do-i-do-security-in-jsf問候 – 2013-05-14 09:57:34