Annotation Type JerseyContext
-
@Qualifier @Retention(RUNTIME) @Target({METHOD,FIELD,PARAMETER,TYPE}) public @interface JerseyContextQualifier used for injecting the CDI beans using
@Inject. Used only for beans that originate in Specification other than Jakarta RESTful Web Services (such as Servlet). Such beans must not be produced with@Defaultqualifier so that there is no ambiguity for the CDI injection.Jakarta REST Spec. Section 11 demands
HttpServletRequest,HttpServletResponse,ServletContext,ServletConfig, andFilterConfigto be available by injections using@Context. For CDI, these servlet classes are available withJerseyContextqualifier.Note that
@Contextinjection is not aware of the qualifier and using@Contextin conjuction with@JerseyContextwill not work.Can be used as e.g.
@Inject @JerseyContext //internal HttpServletRequest httpServletRequest;
or as iterable of allHttpServletRequestbeans@Inject @Any Instance<HttpServletRequest> httpServletRequests;
- Since:
- 2.38