0 Replies Latest reply on Dec 23, 2011 6:19 AM by Parimal Chauhan

    How to redirect on login page from Seam Interceptor ?

    Parimal Chauhan Newbie

      Hello,


      I have created Interceptor which checks user is logged in and has appropriate authentications or not. upon user has no rights to access given pages i want to redirect him on login page back.


      but it is not getting redirected on login page.


      Please help..


      below is the interceptor code..


      @AroundInvoke
      public Object checkLoggedIn(InvocationContext invocation) throws Exception {
      
      boolean isLoggedIn = Contexts.getSessionContext().get("currentUser")!=null;
                 
                if(isLoggedIn){
                     return invocation.proceed();     
                }else{
                     
                     return "login.xhtml";
                }
                
           }