About Question enthuware.ocejws.v6.2.315 :

Moderators: Site Manager, fjwalraven

Post Reply
blacksnow666
Posts: 13
Joined: Thu Apr 24, 2014 9:23 pm
Contact:

About Question enthuware.ocejws.v6.2.315 :

Post by blacksnow666 »

"A Servlet-based implementation MUST support injection of the following Servlet-defined types: ServletConfig, ServletContext, HttpServletRequest and HttpServletResponse."
why is this correct?

Code: Select all

@Context HttpHeaders hdrs; 

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

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

Post by fjwalraven »

@Context is a standard JAX-RS annotation.

Check https://jersey.java.net/documentation/1 ... guide.html 2.3. Extracting Request Parameters, example Example 2.18.

Or JAX-RS v1.1 Chapter 5. Context, 5.2.3 Headers.
An instance of HttpHeaders can be injected into a class field or method parameter using the @Context annotation.

I will update the explanation.

Regards,
Frits

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests