增加springmvc 全局异常处理、拦截器示例代码

This commit is contained in:
罗祥
2018-12-18 17:23:02 +08:00
parent c54d520737
commit c3428d4056
16 changed files with 299 additions and 2 deletions

View File

@ -24,4 +24,21 @@
<!-- 后缀 -->
<property name="suffix" value=".jsp"/>
</bean>
<!--配置拦截器-->
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/mvc/**"/>
<mvc:exclude-mapping path="/mvc/login"/>
<bean class="com.heibaiying.interceptors.MyFirstInterceptor"/>
</mvc:interceptor>
<mvc:interceptor>
<mvc:mapping path="/mvc/**"/>
<bean class="com.heibaiying.interceptors.MySecondInterceptor"/>
</mvc:interceptor>
</mvc:interceptors>
<!--配置全局异常处理器-->
<bean class="com.heibaiying.exception.NoAuthExceptionResolver"/>
</beans>