Here is my XML configuration:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
...
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
... ">
<resources mapping="/resources/**" location="/resources/" />
<resources mapping="/style/**" location="/resources/style/" />
<resources mapping="/script/**" location="/resources/script/" />
<resources mapping="/images/**" location="/resources/images/" />
<resources mapping="/uploaded/**" location="/resources/uploaded/" />
<interceptors>
<interceptor>
<mapping path="/**" />
<exclude-mapping path="/style/**" />
<exclude-mapping path="/script/**" />
<exclude-mapping path="/images/**" />
<exclude-mapping path="/uploaded/**" />
<exclude-mapping path="/resources/**" />
<beans:bean class="com.example.MyInterceptor" />
</interceptor>
</interceptors>
</beans:beans>
My issue is when I browse a file in /style
or other path in exclude mappins, such as /style/style.css
, the interceptor code still run. Even if I change the config to <exclude-mapping path="/style/*" />
, the issue still happen.
How do I set the config file to let <exclude-mapping>
work?