I'm using JAAS to secure my web-application. As the title says, the problem is that i get the home page which is in the protected folder instead of the login page. Actually the home page is my welcome page. By the way, it works fine when i write the URL (/myappJaas/protected/admin/homeadmin.xhtml) in the web browser. This is the web.xml file:
<welcome-file-list>
<welcome-file>/protected/admin/homeadmin.xhtml</welcome-file>
</welcome-file-list>
<security-constraint>
<web-resource-collection>
<web-resource-name>admins</web-resource-name>
<url-pattern>/protected/admin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/public/login.xhtml</form-login-page>
<form-error-page>/public/errorlogin.xhtml</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>admin</role-name>
</security-role>