【发布时间】:2026-01-19 11:05:02
【问题描述】:
我正在尝试将 spring MVC 配置为不对任何没有身份验证的页面进行身份验证(启用 ROLE_ANONYMOUS 的使用,因为所有页面都明确要求)。
但我在调试日志中收到此消息:
o.s.s.w.a.i.FilterSecurityInterceptor - Public object - authentication not attempted
FilterSecurityInterceptor 由命名空间添加。我认为我需要在过滤器上setRejectPublicInvocations 来禁用它。
但我看不到任何通过 http 命名空间执行此操作的方法。我是否必须完全放弃使用 http 命名空间才能完成此操作?
【问题讨论】:
-
看看你的 applicationContext-security.xml 会很有用
标签: java spring spring-mvc spring-security