我想你必须改变你的web.xml ......
您必须将受限资源放入适当的文件夹。这样,Filter Servlet将限制在“restricted”文件夹中分配的文件。(http://www.developer.com/security/article.php/3467801/Securing-J2EE-Applications-with-a-Servlet-Filter.htm)(我认为使用Filter Servlet的原因是编写自己的授权系统。 - 这样你就不必在Web中定义安全约束了.xml,你必须在数据库中定义它;))))
AuthorizationFilter
examples.AuthorizationFilter
This Filter authorizes user access to application
components based upon request URI.
error_page
../../login.html
AuthorizationFilter
/restricted/*