Question

i try to use JAAS for authetification so i configured my web.xml:

<security-constraint>
    <web-resource-collection>
        <web-resource-name>Admin</web-resource-name>
        <url-pattern>/servlets/ForbiddenServlet</url-pattern>
    </web-resource-collection>
    <web-resource-collection>
    <auth-constraint>
        <role-name>admin</role-name>
    </auth-constraint>
</security-constraint>

<security-role>
   <role-name>admin</role-name> 
</security-role>

<login-config>
    <auth-method>FORM</auth-method>
    <realm-name>Admin</realm-name>
    <form-login-config>
        <form-login-page>/../pages/login.jsp</form-login-page>
        <form-error-page>/../pages/error.jsp</form-error-page>
    </form-login-config>
</login-config>

If i go on my ForbiddenServlet page theres just a white screen... i thought the login.jsp would be shown.

If id dont use FORM and use BASIC instead it works fine!

EDIT: with "it works fine!" i dont mean that the login.jsp is shown but a default login window pops up.

Was it helpful?

Solution

form-login-page and form-error-page are paths relative to the webapp root. I think you should remove the "/.." part.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top