Best practice is to use the default security mechanism of your container.

 

Something like:

[code]

            <login-config>

                        <auth-method>FORM</auth-method>

                        <realm-name>myRealm</realm-name>

                        <form-login-config>

                                   <form-login-page>/login.jsf</form-login-page>

                                   <form-error-page>/login-error.jsf</form-error-page>

                        </form-login-config>

            </login-config>

[/code]

 

Check your applicationserver descriptor how to set an authenticator.

 

Greets Dennie


From: Hasnain Badami [mailto:[EMAIL PROTECTED]
Sent: dinsdag 18 april 2006 17:18
To: MyFaces Discussion
Subject: Faces context is null

 

Hi

 

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.

Any idea of why this is happening?

 

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.

 

Thanks

 

Hassnain

Reply via email to