【发布时间】:2013-05-14 09:33:13
【问题描述】:
我知道 可以在 faces-config.xml 文件中设置导航规则。但是在那里,我只知道在正确的流程中进行导航的选项。
但我想避免未登录的用户在地址栏中键入 URL 时直接进入主屏幕。 是否可以在配置文件中执行此操作,还是必须将 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>
希望你能帮助我。
【问题讨论】: