1 Reply Latest reply on Aug 29, 2007 12:39 PM by Richard Leherpeur

    Login Redirection

    Richard Leherpeur Novice

      I'm using JBoss4.2.0.GA with jboss-seam-CVS.2007-08-22_00-49-47

      I have the following pages.xml configuration:

      <pages xmlns="http://jboss.com/products/seam/pages"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"
      
       no-conversation-view-id="/public/error/noConversation.xhtml"
       login-view-id="/public/login.xhtml">
      
       <page view-id="/restricted/*" login-required="true"/>
      
       <page view-id="*">
       <navigation>
       <rule if-outcome="account">
       <redirect view-id="/restricted/account.xhtml"/>
       </rule>
       </navigation>
       </page>
      
      ...
      <pages>
      


      I have the following link in my xhtml page:

      <s:link action="account" value="View my account" />
      


      When I click on the link, I see the login page as expected. But then after I login, the login page is reloaded instead of being redirected to the account page.

      I checked that the authenticate method was returning true, so the login works fine. It is just that I'm not redirected as expected after login in.

      Do I do anything wrong here?

      thanks,

      Richard

        • 1. Re: Login Redirection
          Richard Leherpeur Novice

          It appeared I just forgot the following in components.xml

           <event type="org.jboss.seam.notLoggedIn">
           <action expression="#{redirect.captureCurrentView}"/>
           </event>
           <event type="org.jboss.seam.postAuthenticate">
           <action expression="#{redirect.returnToCapturedView}"/>
           </event>
          


          Works much better now :)