1 Reply Latest reply on Jul 26, 2011 11:41 AM by Tom Bryan

    Redirect order of Page event actions

    Hong Kong Newbie

      I have some problems with the redirect component for the auto-login.

      In the components.xml i have these

      <event type="org.jboss.seam.security.notLoggedIn">
        <action execute="#{redirect.captureCurrentView}"/>
        <action execute="#{authenticator.tryLogin()}"/>
       <event type="org.jboss.seam.security.loginSuccessful">
        <action execute="#{redirect.returnToCapturedView}"/>

      and additionally in the pages.xml

          <exception class="org.jboss.seam.security.NotLoggedInException" log-level="debug">
              <redirect view-id="/signon.xhtml">
                  <message>Bitte melde dich erst an.</message>
          <exception class="javax.faces.application.ViewExpiredException" log-level="info">
              <redirect view-id="/index.xhtml">
                  <message>Deine Sitzung ist abgelaufen, bitte melde Dich erneut bei frents an.</message>

      The first problem was, identity.tryLogin() does a silenct login so no loginSuccessful event is raised. Therefore i raise it myself in authenticator.tryLogin(). So the first 3 methods are called in a row, but the exception handler seems to be the one deciding that its going to /signon.xhtml. Is it ok to skip the exception handling and do the redirect in tryLogin()==false. And for viewExpiredException the same (if there is a viewExpired Event). Any suggestions?