0
我正在使用JAAS来保护我的web应用程序。正如标题所说,问题是我得到的是保护文件夹中的主页,而不是登录页面。其实主页是我的欢迎页面。顺便说一下,当我在Web浏览器中写入URL(/myappJaas/protected/admin/homeadmin.xhtml)时,它工作正常。这是web.xml文件:为什么我得到受保护的页面而不是登录页面?
<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>