我使用的是Spring 3.0
我需要编写一个拦截器来拦截所有网址。在我的应用程序中
我写了一个拦截器
public class HelloInterceptor extends HandlerInterceptorAdapter {
如何在 spring-servlet.xml 中配置它。
最佳答案
使用<mvc:interceptors>
(参见 docs ),例如
An example of registering an interceptor applied to all URL paths:
<mvc:interceptors>
<bean class="x.y.HelloInterceptor" />
</mvc:interceptors>
关于spring-mvc - 在Spring中配置拦截器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5260179/