Hello,

I use my own ViewHandler to do authentication checks. Here is the code of the class I use, it was posted by Adam Winer in another forum. It worked with 1.0.9, but doesn't with 1.1.0.
The createView() method gets called but changing the viewID (to force a
redirect to an authentication template) doesn't work anymore.

Any ideas?

Thanks a lot,
Patrick


public class AuthenticatingViewHandler extends ViewHandler
{
    public AuthenticatingViewHandler(ViewHandler base)
    {
      _base = base;
    }

   public UIViewRoot createView(FacesContext facesContext, String viewID )
   {
User user = (User) facesContext.getExternalContext().getSessionMap().get("user");
     if (user == null)
       viewID  = "/login.jsf";

     return _base.createView(facesContext, viewID );
   }

   // ..etc.. - all the other methods, just call through to _base

   private final ViewHandler _base;
  }

Reply via email to