users@jersey.java.net

[Jersey] Re: _at_Context field injection timing

From: John Yeary <johnyeary_at_gmail.com>
Date: Sun, 22 Jan 2012 05:49:23 -0500

What version of Jersey are you using? That is the one I use most often, and I usually set it on the field level. Rarely do I set it in the constructor, and I have never set it on the setter.

@Context
UriInfo uriInfo;

Right?

John

Sent from my iPhone

On Jan 21, 2012, at 11:04 PM, Mike Summers <msummers57_at_gmail.com> wrote:

> UriInfo, I haven't played with the others.
>
> --Mike
>
> On Sat, Jan 21, 2012 at 8:36 PM, John Yeary <johnyeary_at_gmail.com> wrote:
> I am not sure of the lifecycle point, but I am curious which @Context object are you trying to inject at a field level.
>
> There are five default context objects: UriInfo, Request, HttpHeaders, SecurityContext, and Providers.
>
> John
> ____________________________
>
> John Yeary
> ____________________________
>
>
> ____________________________
>
> "Far better it is to dare mighty things, to win glorious triumphs, even though checkered by failure, than to take rank with those poor spirits who neither enjoy much nor suffer much, because they live in the gray twilight that knows not victory nor defeat."
> -- Theodore Roosevelt
>
>
>
> On Fri, Jan 20, 2012 at 1:35 PM, <msummers57_at_gmail.com> wrote:
> At what point in the object's lifecycle is field level Context
> injection done?
>
> I've run a simple experiment and can get @Context UriInfo injected on
> the constructor and a setter bean but can't seem to get a @Context
> annotated field set.
>
> TIA.
>
>