[jboss-user] [JBoss Seam] - Re: pages.xml redirect if loggedIn

fernando_jmt do-not-reply at jboss.com
Thu Apr 12 12:15:48 EDT 2007


Yes, you can fire an action before render.

I resolved a similar problem as follows:

  | <page view-id="/login.xhtml" action="#{authenticator.checkIfLoogedIn}">
  |         <navigation from-action="#{authenticator.checkIfLoogedIn}">
  |             <rule if="#{identity.loggedIn}">
  |                 <redirect view-id="/home.xhtml"/>
  |             </rule>
  |         </navigation>
  |         <navigation from-action="#{identity.login}">
  |             <rule if="#{identity.loggedIn}">
  |                 <redirect view-id="/home.xhtml"/>
  |             </rule>
  |         </navigation>
  |     </page>
  | 

The authenticator.checkIfLoogedIn method is called before render the page (it is an empty dummy method). So, if the user is already logged in he is redirected to correct page instead showing the login page again.

HTH.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036784#4036784

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036784



More information about the jboss-user mailing list