您的位置:首页 > 编程语言 > Java开发

Spring参考手册 mvc:interceptors

2011-07-02 15:24 411 查看
This tag allows you to register custom HandlerInterceptors or WebRequestInterceptors that should be applied to all HandlerMapping beans.
You can also restrict the URL paths specifc interceptors apply to.
这个标签注册自定义的拦截器或请求拦截器
也可以拦截指定url路径
An example of registering an interceptor applied to all URL paths:
注册全部url到拦截器:
<mvc:interceptors>
<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" />
</mvc:interceptors>
An example of registering an interceptor limited to a specific URL path:
注册指定url到拦截器:
<mvc:interceptors>
<mvc:interceptor>
<mapping path="/secure/*"/>
<bean class="org.example.SecurityInterceptor" />
</mvc:interceptor>
</mvc:interceptors>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: