通过声明类型为MappedInterceptor的bean并将其注入我的拦截器(扩展了HandlerInterceptorAdapter),Spring
Data Rest拾取了我的拦截器,并且现在可以在应用程序上的任何URL上使用。
这转化为以下实现(替换了我原来的问题):
@Configurationpublic class WebMvcConfig extends WebMvcConfigurerAdapter { @Autowired DBEditorTenantInterceptor dbEditorTenantInterceptor; @Bean public MappedInterceptor dbEditorTenantInterceptor() { return new MappedInterceptor(new String[]{"/**"}, dbEditorTenantInterceptor); }}
不幸的是,我在Spring文档中找不到对此的任何引用。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)