cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Noordhuis (JIRA)" <>
Subject [jira] Commented: (CXF-3379) @Context fails to inject Application instance
Date Mon, 07 Mar 2011 16:59:02 GMT


Ben Noordhuis commented on CXF-3379:

Sergey, would this be an acceptable approach? Tests and style checks pass. Color diff and
raw patch:

I'll write some unit tests if you give the green light.

> However, I don't understand why would a root resource or provider class want to have
Application instance injected ? Can you explain please what you'd use it for ?

For that configuration information the JSR talks about or as the source of service objects
in a plain servlet web app (think MyApplication.getWidgetDao() and such). It's a good place
for it, right?

> @Context fails to inject Application instance
> ---------------------------------------------
>                 Key: CXF-3379
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.3
>            Reporter: Ben Noordhuis
> Quoting JSR 311:
> "The instance of the application-supplied Application subclass can be injected into a
class field or method parameter using the @Context annotation. Access to the Application subclass
instance allows configuration information to be centralized in that class. Note that this
cannot be injected into the Application subclass itself since this would create a circular
> JAXRSUtils.createContextValue() doesn't handle this. This bug exists in 2.3.x and HEAD.
> I'd submit a patch but I don't know where (or if) the Application class is registered
after it's instantiated by CXFNonSpringJaxrsServlet.

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message