gpt4 book ai didi

java - 带有正则表达式的 Spring Security 模式

转载 作者:行者123 更新时间:2023-12-02 16:57:34 24 4
gpt4 key购买 nike

我需要拦截具有以下模式的网址:

<intercept-url pattern="empresas/?/*" ...

“?”在哪里?是一个整数,例如empresas/5/*、empresas/1/** 等

如何编写模式来拦截此类 URL?

最佳答案

您需要将周围的 http 元素上的 request-matcher 属性设置为 regex 以告诉 Spring 您要使用正则表达式pattern 属性中的语法,请参见例如http://docs.spring.io/spring-security/site/docs/3.2.2.RELEASE/reference/htmlsingle/#nsa-http-attributes .

关于java - 带有正则表达式的 Spring Security 模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31093938/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com