4 Replies Latest reply on Sep 2, 2011 8:08 AM by hantsy

    How to force user to login?

    hantsy

      Seam 2 provided simple to force user to login page.
      How to do in Seam 3?


      I have tried to use @ViewConfig...(copied the codes from Seam faces document), it does not work.


      I have created three pages, home.xhtml, denied.xhtml, login.xhtml.


      @ViewConfig
      public interface Pages {
           
           enum Pages1{
                
                @FacesRedirect
                   @ViewPattern("/*")
                   @AccessDeniedView("/denied.xhtml")
                   @LoginView("/login.xhtml")
                   ALL;
                
           }
      
      }
      
      



      and a simple config in prettfaces.xml to map the / to /home.xhtml.




       <url-mapping id="home">
              <pattern value="/"></pattern>
              <view-id>/home.xhtml</view-id>
       </url-mapping>