CorsConfigurer (the Java/lambda HttpSecurity.cors() DSL) auto-detects a
CorsConfigurationSource (via the mvcHandlerMappingIntrospector bean) or a
PreFlightRequestHandler bean when neither is configured explicitly (added
in #18926). The XML <cors> namespace element has no equivalent: without a
configuration-source-ref or ref attribute, CorsBeanDefinitionParser
throws a BeanCreationException.
Add a CorsFilterFactoryBean, used by CorsBeanDefinitionParser when
configuration-source-ref is omitted, that mirrors CorsConfigurer's
detection logic — so XML configuration has the same implicit-bean-detection
behavior as Java configuration.
Related to #18926.
CorsConfigurer(the Java/lambdaHttpSecurity.cors()DSL) auto-detects aCorsConfigurationSource(via themvcHandlerMappingIntrospectorbean) or aPreFlightRequestHandlerbean when neither is configured explicitly (addedin #18926). The XML
<cors>namespace element has no equivalent: without aconfiguration-source-reforrefattribute,CorsBeanDefinitionParserthrows a
BeanCreationException.Add a
CorsFilterFactoryBean, used byCorsBeanDefinitionParserwhenconfiguration-source-refis omitted, that mirrorsCorsConfigurer'sdetection logic — so XML configuration has the same implicit-bean-detection
behavior as Java configuration.
Related to #18926.