[jboss-user] [JBoss Seam] - redirect based on roles

lsabin do-not-reply at jboss.com
Wed Dec 19 02:54:09 EST 2007


Hi.

In my application after the user logs in I want to redirect to a different page based on the user role. This is the relevant portion of my pages.xml:


  |         <navigation from-action="#{identity.login}">
  |             <rule if="#{s:hasRole('user')}">
  |                 <redirect view-id="/details.xhtml"/>
  |             </rule> 
  |             
  |             <rule if="#{s:hasRole('admin')}">
  |                 <redirect view-id="/home.xhtml"/>
  |             </rule> 
  |         </navigation>
  | 



The first time the user with role 'user' logs in this navigation rule does not work and the  user gets redirected to the home.xhtml page. But if I logout and log in again it works fine and redirects to details.xhtml.

Could someone explain this behaviour?

Thanks.

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

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



More information about the jboss-user mailing list