Spring Interceptor在Spring Data REST URL中不起作用

Spring Interceptor在Spring Data REST URL中不起作用,第1张

Spring Interceptor在Spring Data REST URL中不起作用

通过声明类型为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文档中找不到对此的任何引用。



欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5621635.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-15
下一篇 2022-12-15

发表评论

登录后才能评论

评论列表(0条)

保存