处理 spring 网络中的 # 个字符

Handle # character in spring web

我正在尝试为 Spring 中的安全规则添加例外,但收到 401,这意味着我的映射无法识别。 uri 是 /test/acc#v1=1&v2=2...

我配置了安全性: http.authorizeExchange().pathMatchers("/test/acc*{v:.+}")

http.authorizeExchange().pathMatchers("/test/acc*")

我的控制器注释是:

@GetMapping("/test/acc{suffix:.+}")

None 有效,我一直收到 401。有人可以帮我解决这个问题吗?

普遍认为服务器不会收到 URL 碎片详细信息,它适用于所有主要服务器 java 基于服务器,如 tomcat、jetty..etc please refer for more details