开发者

Configure @Viewconfig Seam faces 3

开发者 https://www.devze.com 2023-03-31 18:54 出处:网络
I\'m working on a simple project. My site will have only 2 pages. The front page, with the ogin and register controls, and a user page, that the user will be redirected after logged in or registered.

I'm working on a simple project. My site will have only 2 pages. The front page, with the ogin and register controls, and a user page, that the user will be redirected after logged in or registered. I have so开发者_如何学Cme questions:

How can I implement a remember me feature with seam 3?

How can I automatic redirect a logged in user to the user page?

When the user click logoff, how can I redirect him to the front page?

Thanks


The easiest way to make redirect after logoff action and automatic redirect a logged in user is navigation rule. You can write this rules in faces-config.xml for example:

<navigation-rule>
    <from-view-id>*</from-view-id>

    <navigation-case>
        <from-action>#{identity.logout}</from-action>
        <if>#{true}</if>
        <to-view-id>/frontPage.xhtml</to-view-id>
        <redirect/>
    </navigation-case>
</navigation-rule>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号