我正在寻找一种以编程方式加载给定拦截器的方法。
我已经看到了一种为给定 bean 动态设置拦截器绑定的方法,但是该绑定的拦截器必须在 beans.xml 中定义。我知道我可以使用@Interceptors注释,但这样我就被绑定到一个特定的实现。
@Interceptors
有没有办法加载拦截器(可能通过 CDI 扩展)? 或者一种让拦截器默认启用而无需声明的方法<interceptors></interceptors>?
<interceptors></interceptors>
我正在使用 Weld-1.1.24
cdi weld jakarta-ee
cdi ×1
jakarta-ee ×1
weld ×1