4 Replies Latest reply on Apr 12, 2007 3:33 PM by Fernando Montaño

    pages.xml redirect if loggedIn

    Damian Harvey Master

      My understanding is that navigation rules in pages.xml fire after the page render (eg. after an action). Is there any way to use a navigation rule to fire before the render (ie. similar to an action)?

      Currently I have a rule in my login.page.xml that redirects users to the home page after they login successfully. This works fine, however if a user has bookmarked the login page and calls it again after login, the navigation rule is not hit (as it is before the render) and the login page is displayed again - and typically the user thinks that they've been logged out.

       <rule if="#{identity.loggedIn}">
       <redirect view-id="/secure/home.xhtml"/>

      This same rule exists in the Booking example and the same behaviour occurs.

      I've designed around this but am still curious as to how pages.xml might be used to get around this.