You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2009/07/09 10:36:14 UTC

[jira] Commented: (CXF-2335) @Context does not work for JAX-RS member fields

    [ https://issues.apache.org/jira/browse/CXF-2335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12729103#action_12729103 ] 

Sergey Beryozkin commented on CXF-2335:
---------------------------------------

We have quite a few tests which show the @Context fields get injected.

Is your class Spring-proxified by any chance ? If yes then

class Resource implements SomeInterfaceWithSetUriInfoMethod {

private UriInfo context;


@Context
public void setUriInfo(UriInfo ui) {
    context = ui;
}

} 

will work.

Can you provide more info please ? 


> @Context does not work for JAX-RS member fields
> -----------------------------------------------
>
>                 Key: CXF-2335
>                 URL: https://issues.apache.org/jira/browse/CXF-2335
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 2.2.2
>            Reporter: Hendy Irawan
>
> This works in Jersey, but not in CXF:
> class ........ {
> @Context
> private UriInfo context;
> }
> The alternative, works on both CXF and Jersey:
> class ...... {
> @GET
> public void something(@Context UriInfo context) {
>   ...
> }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.