1 2 Previous Next 16 Replies Latest reply: May 4, 2012 2:31 PM by Bob Shanahan Go to original post RSS
      • 15. Re: ViewScope redirect after login error - IllegalStateException
        Jason Porter Master

        Sure we can reopen. As for a fix, it may need to come from another contributor, my plate is pretty full right now, sorry.

        • 16. Re: ViewScope redirect after login error - IllegalStateException
          Bob Shanahan Newbie

          I agree with Bernard. This is a very common use case. The JSF technique for handling redirect after login is a navigation rule, which conflicts fatally with @ViewConfig.

           

          The following are incompatible:

           

           

          @ViewConfig
          public interface PagesConfig {
          
           static enum Pages
                    {
            @FacesRedirect
            @ViewPattern("/view/*")
                  @LoginView("/login.xhtml")
                  @LoggedIn
                  ALL,
                  
                  @FacesRedirect
                  @ViewPattern("/login.xhtml")
                  LOGIN
                  
                    }
          }
          
          

           

           

           

           

           

              <navigation-rule>
                  <navigation-case>
                      <from-action>#{identity.login}</from-action>
                      <if>#{identity.loggedIn}</if>
                      <to-view-id>/view/home.xhtml</to-view-id>
                      <redirect/>
                  </navigation-case>
          
                  <navigation-case>
                      <from-action>#{identity.login}</from-action>
                      <from-outcome>failed</from-outcome>
                      <to-view-id>/login.xhtml</to-view-id>
                  </navigation-case>
              </navigation-rule>
          
          

           

           

          1 2 Previous Next