The recommended way to achieve this is with pages.xml. Here's a snippet from
pages.xml from the seamspace example that redirects to the users profile page
after logging in:
page view-id=/home.xhtml
| navigation from-action=#{identity.login}
| rule
| !-- Tell the system where to send the user after login --
| page view-id=/login.xhtml
| navigation from-action=#{identity.login}
| rule if-outcome=loggedIn
| redirect view-id=/pages/mainpage.xhtml/
| /rule
|
Identity.login() returns a loggedIn outcome if authentication is successful.
Alternatively you can use:
| rule if=#{identity.loggedIn}
|
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4034601#4034601
Reply to the post :
| !-- Tell the system where to send the user after login --
| page view-id=/login.xhtml
| navigation from-action=#{identity.login}
| rule if=#{identity.loggedIn}
| redirect view-id=/pages/mainpage.xhtml/
| /rule
|
aha!
the page was actually:
| !-- Tell the system where to send the user after login --
| page view-id=/pages/user/login.xhtml
| navigation from-action=#{identity.login}
| rule if=#{identity.loggedIn}
| redirect view-id=/pages/mainpage.xhtml/