天天看點

springmvc配置攔截器

在springmvc.xml檔案裡添加:

<mvc:interceptors>
        <mvc:interceptor>
            <mvc:mapping path="/**"/>
            <bean class="com.xxx.xxx.interceptor.XxxInterceptor"/>
        </mvc:interceptor>
    </mvc:interceptors>
           

"/**" 代表攔截所有請求。

繼續閱讀