About Question enthuware.ocejws.v6.2.316 :

Moderators: Site Manager, fjwalraven

Post Reply
sttaq0442
Posts: 27
Joined: Tue Nov 15, 2016 11:20 am
Contact:

About Question enthuware.ocejws.v6.2.316 :

Post by sttaq0442 »

Where can I find all the supported types that go with either @Context or @Resource?

Also, for example WebServiceContext is injected using @Context, can it be injected using @Resource? or vice versa?

Thanks

fjwalraven
Posts: 429
Joined: Tue Jul 24, 2012 2:43 am
Contact:

Re: About Question enthuware.ocejws.v6.2.316 :

Post by fjwalraven »

@Resource is defined in JSR-250.
@Context in the Jersey documentation.

The WebServiceContext is described in JAX-WS 2.x:
The javax.annotation.Resource annotation defined by JSR-250 is used to request injection of the WebServiceContext
Regards,
Frits

witek_m
Posts: 16
Joined: Sat Jun 09, 2018 12:09 pm
Contact:

Re: About Question enthuware.ocejws.v6.2.316 :

Post by witek_m »

Hello, I'd like to make sure: every Object from "ServletConfig, ServletContext, HttpServletRequest and HttpServletResponse." except ServletConfig and ServletContext could be injected by @Context in this case?

fjwalraven
Posts: 429
Joined: Tue Jul 24, 2012 2:43 am
Contact:

Re: About Question enthuware.ocejws.v6.2.316 :

Post by fjwalraven »

from the JAX-RS v1.1 specs (important don't read any newer version):
The @Context annotation can be used to indicate a dependency on a Servlet-defined resource. A Servlet- based implementation MUST support injection of the following Servlet-defined types: ServletConfig, ServletContext, HttpServletRequest and HttpServletResponse.
Regards,
Frits

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 13 guests