[jboss-user] [JBoss Seam] - Re: How to dynamically navigate after identity.login()

tonylmai do-not-reply at jboss.com
Fri Mar 2 14:45:06 EST 2007


You can override the RuleBasedIdentity.login to redirect the user to the correct page.

@Name("org.jboss.seam.security.identity")
  | @Scope(ScopeType.SESSION)
  | @Intercept(InterceptionType.AFTER_RESTORE_VIEW)
  | public class YourNewIdentity extends RuleBasedIdentity {
  | ...
  | 	@Override
  | 	public String login() {
  | 		super.login(); /* Ignore outcome from super */
  | 		
  | 		// check user role and return the correct view
  | 		if (user has role x) {
  | 			return "goto x page";
  | 		} else {
  | 			return "goto y page";
  | 		}
  | 	}
  | 

Don't forget to take out the navigation rule in the page.xml.

Hope it helps.


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

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



More information about the jboss-user mailing list