12.3.6 Login Redirection
tony.herstell1 Apr 4, 2007 9:23 AM
<event type="org.jboss.seam.postAuthenticate">
<action expression="#{redirect.returnToCapturedView}"/>
</event>
After a successful login I want to send my user to a specific page (not only the page they came from!).
Basically I have a login page supported by a controller
/* (non-Javadoc)
* @see de.co.clickstream.actions.user.LoginController#startLogin()
*/
@Begin
public String startLogin() {
log.info(">startLogin");
log.info("Starting Login conversation.");
if (conversation != null) {
log.info("Conversation. (" + conversation.getId() + ")");
}
log.info("<startLogin");
return "login";
}
public String switchToRegistration() {
log.info(">switchToRegistration");
log.info("<switchToRegistration");
return "registration";
}
/* (non-Javadoc)
* @see de.co.clickstream.actions.user.LoginController#cancel()
*/
@End
public String cancel() {
log.info(">cancel");
log.info("<cancel");
return "mainPage";
}
/* (non-Javadoc)
* @see de.co.clickstream.actions.user.LoginController#destroy()
*/
@Remove @Destroy
public void destroy() {
log.info(">destroy");
log.info("<destroy");
}
I want to send them to a "members" page after login.
Is it possible to do something like:
<event type="org.jboss.seam.postAuthenticate">
<action expression="#{membresPageController.startXXX}"/>
</event>
or just for a "menu page":
<event type="org.jboss.seam.postAuthenticate"> <action page="membersPage" activeConversation="die"/> </event>
where membersPage is a navigation rule:
[page]
<navigation-rule>
<navigation-case>
<from-outcome>membersPage</from-outcome>
<to-view-id>/pages/membersPage.xhtml</to-view-id>
</navigation-case>
[/page]
Of course I would want to complete the authentication conversation if there was one so I may actually want to go to my loginController and call a routine to go somewhere (this seems nicer):
/* (non-Javadoc)
* @see xxx.user.LoginController#handleSuccessfulLogin()
*/
@End
public String handleSuccessfulLogin() {
log.info(">handleSuccessfulLogin");
log.info("<handleSuccessfulLogin");
return "membersPage";
}
Please advise...
Very tired so make be %(*&(*&^ obvious by the morning!