问题标签 [name-binding]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
40 浏览

java - 无法使用 cxf 让 @NameBinding 为 jaxrs 拦截器工作

我有 2 个拦截器用于请求响应日志记录。我正在尝试让我的 Reader/Writer Interceptor 与 @NameBinding 一起使用。如果我在 beans.xml 中为服务器添加提供程序,它可以工作,如下所示:

但是由于这将拦截器与所有资源绑定在一起,我尝试了以下使用 @NameBinding 并将其仅绑定到特定资源。

FooAnnotation.java:

FooReaderInterceptor/FooWriterInterceptor :

资源接口:

资源实施:

使用的依赖项:

使用上面的代码,当我触发带注释的资源时,不会调用拦截器。需要帮忙!如果需要更多信息,请告诉我。