2 Replies Latest reply on Jul 28, 2010 2:59 PM by Wang Liyu

    jsf navigation help

    Aaron Siri Newbie
      I know this is more of a JSF question rather than a Seam 3 question but everybody here is so helpful and knowledgeable on JSF I figured I would ask it here...

      In Seam 2 I believe there was a way to intercept page navigation in such a way that you could always go to the login page if, say, identity.isLoggedIn() was false.  This would happen no matter which page you attempted to go to or where you navigated from.

      How do you do the same with JSF 2.0 faces-config.xml?  I want to always go to login.xhtml if identity.isLoggedIn() is false.  Any way to do this?

      I tried the following with no success (I also tried it without the <from-view-id> part):

      <navigation-rule>
         <from-view-id>*</from-view-id>
         <navigation-case>
            <if>#{!identity.isLoggedIn()}</if>
            <to-view-id>login.xhtml</to-view-id>
            <redirect />
         </navigation-case>
      </navigation-rule>

      Thanks!

      -Aaron