springmvc interceptor then filtered through a positive static resources

First, you need to configure static resources springmvc filter,

Then the custom filter configuration url intercepted,

Using regular settings can url

. * [^ ((Js) | (png))] $ represent not to js, ​​png end of the url, if there are other just need to continue to add in parenthesis (xx) to

<mvc:resources location="/js/" mapping="/js/**"></mvc:resources>
	<mvc:interceptors>
	<!--可以配置多个拦截器,按顺序执行  -->
	 <!--/**表示所有url包括url路径-->
		<mvc:interceptor>
			<mvc:mapping path=".*[^((js)|(png))]$" />
			<bean class="com.intercepter.LoginIntercepter" />
		</mvc:interceptor>
	</mvc:interceptors>

 

Guess you like

Origin blog.csdn.net/weixin_41796956/article/details/91948364