1

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 some 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

RLuceac
  • 372
  • 1
  • 3
  • 12

1 Answers1

1

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>
Krzysztof Miksa
  • 1,519
  • 1
  • 16
  • 23
  • OK, Thanks!!!! The login redirect i did, but the logout i can't... Now it works... And about the remember me??? the seam 2 solution works in seam 3?? @Krzysio – RLuceac Aug 30 '11 at 12:05