Spring Security Patterns with Regular Expressions

I need to intercept a url with the following pattern:

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

where '?' is an integer, for example. empresas / 5 / *, empresas / 1 / ** etc.

How do I write a template to intercept these types of URLs?

+3


source to share


1 answer


You need to set the attribute request-matcher

on the surrounding element http

to regex

to tell Spring that you want to use regex syntax in the attributes pattern

, see for example http://docs.spring.io/spring-security/site/docs/3.2.2. RELEASE / reference / htmlsingle / # nsa-http-attributes .



0


source







All Articles