0 Replies Latest reply on Dec 23, 2011 6:19 AM by parimal.parimal.chauhan.criti.in

    How to redirect on login page from Seam Interceptor ?

    parimal.parimal.chauhan.criti.in

      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";
                }
                
           }