If you use tomee 1 that's normal since it is a JavaEE 7 feature. TomEE 7 supports it.
A filter is safe if you support asynchroron't use it. Asynchronism or banalized threads is the main issue you can encounter with a ThreadLocal. Romain Manni-Bucau @rmannibucau <https://twitter.com/rmannibucau> | Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber <http://www.tomitribe.com> | JavaEE Factory <https://javaeefactory-rmannibucau.rhcloud.com> 2016-05-08 20:00 GMT+02:00 Kirys <[email protected]>: > On 08/05/2016 18:09, John D. Ament wrote: > >> I know Romain's done some work in this area before. Per the spec, its not >> required to work the way you have it defined. JAX-RS injection via >> @Context is only mandated to work in JAX-RS managed components. >> >> Try to use @Inject instead of @Context, that may be what was implemented >> in >> TomEE. That is mandated in EE7 (but not in EE6). >> >> John >> > @inject gave me an error that it could to find a class to inject, I don't > remember. > For now I managed to populate the data I need using filters, not really > elegant but works, is it safe to put it in a filter? > Thank you > F >
