> I am trying to implement a security filter. In the doFilter method if I am
> trying to get the faces context using FacesContext.getCurrentInstance() but
> this instruction returns null.

Right!

> Any idea of why this is happening?

FacesContext is setup inside of FacesServlet.service() ([1]) for each request.
So your filter is called before service() is call. That's why you get
a null value.


> Actually on authentication failure I would like to reload the login page and
> the main purpose of getting the facescontext is to get the navigationhandler
> and load the login page. Any alternative ideas would be highly appreciated.

J2EE based security might be usful. Or ou may try a PhaseListener
instead, which is called *inside* the Faces framework.

[1] http://tinyurl.com/ha6s5

> Thanks
>
> Hassnain


--
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
http://jroller.com/page/mwessendorf
mwessendorf-at-gmail-dot-com

Reply via email to