Spring MVC - Interceptor never called

后端 未结 6 1975
我寻月下人不归
我寻月下人不归 2021-02-15 15:06

I am trying to configure an interceptor in my application and I am not being able to make it work.

In my application configuration class, I have configured in the follow

6条回答
  •  温柔的废话
    2021-02-15 15:47

    Interceptor classes must be declared in spring context xml configuration file within the tag . Did you do that?

    From the Documentation

    An example of registering an interceptor applied to all URL paths:

    
        
    
    

    An example of registering an interceptor limited to a specific URL path:

    
        
            
            
        
    
    

    So, you would need to configure MyInterceptor class in the spring context xml file

提交回复
热议问题