I'd like to redirect the user to a different page if certain condition is not correct. I'm just wondering if the pages.xml is a right place to do it. I tried the following but it doesn't work:
<page view-id="/protectedPage.xhtml" login-required="true" conversation-required="true"> <navigation> <rule if="#{empty authenticationSessionId}"> <redirect view-id="/authenticationPage.xhtml" /> </rule> </navigation> </page>
Sure, that is the right way to do it. However, note that your navigation rule won't be fired unless some action is called. So if you expect it to fire on a GET request, you need a page action.