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 » Wed Nov 16, 2016 1:59 pm

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: 423
Joined: Tue Jul 24, 2012 2:43 am
Contact:

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

Post by fjwalraven » Wed Nov 16, 2016 2:53 pm

@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 » Fri Jun 15, 2018 12:25 pm

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: 423
Joined: Tue Jul 24, 2012 2:43 am
Contact:

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

Post by fjwalraven » Sat Jun 16, 2018 8:40 am

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: No registered users and 1 guest