2
当收到Ajax请求()时,我需要调用我自己的intercpetor的方法。拦截器省略了Ajax请求
我将它添加到DefaultAnnotationHandlerMapping
。我的拦截器扩展了HandlerInterceptorAdapter
并实现了ServletContextAware
,InitializingBean
。我怎么能解决我的问题?
当收到Ajax请求()时,我需要调用我自己的intercpetor的方法。拦截器省略了Ajax请求
我将它添加到DefaultAnnotationHandlerMapping
。我的拦截器扩展了HandlerInterceptorAdapter
并实现了ServletContextAware
,InitializingBean
。我怎么能解决我的问题?
您必须手动注册拦截器:
<mvc:interceptors>
<bean class="com.example.MyCustomInterceptor"/>
</mvc:interceptors>
参见:
我已经注册interc eptor使用 。它不适用于Ajax请求。 –
pawb4r
你的意思是说,如果你用浏览器地址栏或者使用'wget' /'curl'输入相同的URL,它可以工作吗? –