【问题标题】:Navigation-rules in JSFJSF 中的导航规则
【发布时间】: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>

希望你能帮助我。

【问题讨论】:

标签: java jsf


【解决方案1】:

安全不是由导航规则来处理的。使用过滤器为您处理它(我建议Spring security)。

【讨论】:

    猜你喜欢
    • 2013-10-22
    • 2014-04-26
    • 1970-01-01
    • 2011-07-05
    • 1970-01-01
    • 2012-02-05
    • 1970-01-01
    • 1970-01-01
    • 2014-02-20
    相关资源
    最近更新 更多