users@jersey.java.net

[Jersey] Re: _at_Context field injection timing

From: Mike Summers <msummers57_at_gmail.com>
Date: Mon, 23 Jan 2012 09:21:51 -0600

Jersey 1.3

I had a bug in my test case, looks like the execution order for @Context
UriInfo is:
1) Constructor (makes sense)
2) Field
3) Bean/Setter

On Sun, Jan 22, 2012 at 4:49 AM, John Yeary <johnyeary_at_gmail.com> wrote:

> 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
>> ____________________________
>>
>> <http://javaevangelist.blogspot.com/> <https://twitter.com/jyeary> <http://www.youtube.com/johnyeary>
>> <http://www.linkedin.com/in/jyeary> <https://plus.google.com/112146428878473069965>
>> <http://www.facebook.com/jyeary> <http://feeds.feedburner.com/JavaEvangelistJohnYearysBlog>
>> <http://netbeans.org/people/84414-jyeary>
>> ____________________________
>>
>> "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.
>>>
>>
>>
>