我试图设置安全约束反向。我想说的是,除了我指定的以外,所有页面都需要登录。我用:设置反向安全约束
<security-constraint>
<web-resource-collection>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>*</role-name>
</auth-constraint>
</security-constraint>
但我不知道该怎么说index.jsp不需要登录。
虽然这是100%正确的,但是OP询问web.xml部署描述符,并没有指出他们正在使用spring-security。由于web.xml约束是在容器级别执行的,因此这两种方法也不容易混合。 – 2011-01-30 13:36:50