Skip to content

Spring Security 7 should support ant request matcher in xml config #18211

@rady66

Description

@rady66

Describe the bug
XML config does not work for request matcher of type ant as per the xsd.

SEVERE  2025-11-24 10:23:46 30   ebApplicationContext Caused by: java.lang.IllegalArgumentException: No enum constant org.springframework.security.config.http.MatcherType.ant
SEVERE  2025-11-24 10:23:46 30   ebApplicationContext 	at java.base/java.lang.Enum.valueOf(Enum.java:293)
SEVERE  2025-11-24 10:23:46 30   ebApplicationContext 	at org.springframework.security.config.http.MatcherType.valueOf(MatcherType.java:37)
SEVERE  2025-11-24 10:23:46 30   ebApplicationContext 	at org.springframework.security.config.http.MatcherType.fromElement(MatcherType.java:76)
SEVERE  2025-11-24 10:23:46 30   ebApplicationContext 	at org.springframework.security.config.http.MatcherType.fromElementOrMvc(MatcherType.java:83)
SEVERE  2025-11-24 10:23:46 30   ebApplicationContext 	at org.springframework.security.config.http.FilterChainMapBeanDefinitionDecorator.decorate(FilterChainMapBeanDefinitionDecorator.java:50)
SEVERE  2025-11-24 10:23:46 30   ebApplicationContext 	at org.springframework.security.config.SecurityNamespaceHandler.decorate(SecurityNamespaceHandler.java:135)
SEVERE  2025-11-24 10:23:46 30   ebApplicationContext 	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.decorateIfRequired(BeanDefinitionParserDelegate.java:1438)

To Reproduce
Create an xml config that has ant matcher

<bean id="myFilter" class="org.springframework.security.web.FilterChainProxy">
        <security:filter-chain-map request-matcher="ant">
            <security:filter-chain pattern="/my/login/**" filters="myEntryPoint"/>
        </security:filter-chain-map>
 </bean>

Expected behavior
XML config should support the request matcher types for ant, ciRegex, mvc and regex.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions