This content has been marked as final.
Show 4 replies
-
1. Re: Interceptor in filter and servlet not working in weld-2.2.16.SP1 and apache-tomcat-8.0.26
tremes Oct 2, 2015 4:25 AM (in response to huksley)Hi Ruslan,
AFAIK this is not allowed in CDI spec. Filter and HttpServlet are not beans (only injection targets) and interceptors can be bound to beans only. See Contexts and Dependency Injection for the Java EE platform
-
2. Re: Interceptor in filter and servlet not working in weld-2.2.16.SP1 and apache-tomcat-8.0.26
huksley Oct 2, 2015 4:35 AM (in response to tremes)Hi Thomas, if I deploy same code (but without Weld JARs) into WildFly 9 injection in filter is working.
-
3. Re: Interceptor in filter and servlet not working in weld-2.2.16.SP1 and apache-tomcat-8.0.26
mkouba Oct 2, 2015 4:35 AM (in response to huksley)Hi Ruslan,
unfortunately Weld Servlet does not support interception of servlet components (servlets, filters, listeners). This is only supported in Java EE containers.
-
4. Re: Interceptor in filter and servlet not working in weld-2.2.16.SP1 and apache-tomcat-8.0.26
huksley Oct 2, 2015 4:53 AM (in response to mkouba)Hello Martin!
Thanks for clarification.
As a side note, If I declare @Inject SomeBean bean in servlet
and in SomeBean do @Logged interception declaration then interception is working fine.