PathMatching options:configure all HandlerMappings
Since SPR-11486 and SPR-10163, Path Matching options can be configured to customize path matching options for RequestMappingHandlerMapping. Prior to this commit, the defined pathMatcher and pathHelper instances were only used in RequestMappingHandlerMapping. This commit now registers pathMatcher and pathHelper beans under well-known names and share them with several HandlerMappings beans, such as ViewControllerMappings and ResourcesMappings. Issue: SPR-11753
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
|
||||
|
||||
<mvc:resources mapping="/resources/**" location="/, classpath:/META-INF/" />
|
||||
|
||||
<mvc:annotation-driven>
|
||||
<mvc:path-matching
|
||||
path-helper="pathHelper"
|
||||
path-matcher="pathMatcher" />
|
||||
</mvc:annotation-driven>
|
||||
|
||||
<mvc:view-controller path="/" view-name="home"/>
|
||||
<mvc:view-controller path="/test" view-name="test"/>
|
||||
|
||||
<bean id="pathMatcher" class="org.springframework.web.servlet.config.MvcNamespaceTests$TestPathMatcher" />
|
||||
<bean id="pathHelper" class="org.springframework.web.servlet.config.MvcNamespaceTests$TestPathHelper" />
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user