users@jersey.java.net

[Jersey] Re: how to use custom injection annotation

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Tue, 23 Sep 2014 21:32:41 +0200

Well, you cannot, unless your object is a JAX-RS resource...

Marek

On 23 Sep 2014, at 21:29, 张立鑫 <intelligentcodemail_at_gmail.com> wrote:

> I want to use @Context annotation on my object
>
>
>
> 2014-09-24 3:26 GMT+08:00 Marek Potociar <marek.potociar_at_oracle.com>:
> I guess you want to send your question to WebSocket/Tyrus project mailing list instead.
>
> Marek
>
> On 21 Sep 2014, at 17:57, 张立鑫 <intelligentcodemail_at_gmail.com> wrote:
>
>> how to use custom injection annotation and use @Context inject?
>>
>> my code repo at https://github.com/intelligentcode/ameba/tree/master/src/main/java/ameba/websocket
>>
>> binder at https://github.com/intelligentcode/ameba/blob/master/src/main/java/ameba/websocket/internal/ParameterInjectionBinder.java
>>
>> i use new child serviceLocator way at
>> https://github.com/intelligentcode/ameba/blob/master/src/main/java/ameba/websocket/internal/EndpointDelegate.java
>>
>> i want to use @Context in field and @QueryString in filed
>>
>> e.g.
>>
>> @PathParam("sub") //work well
>> String subPath1;
>> @QueryString // don't work
>> String qus;
>>
>> @Context // don't work
>> MessageState messageState;
>>
>> @WebSocket
>> @Path("websocket/async/{sub}")
>> public String asyncWebSocket1(String msg, boolean last, // work well
>> @PathParam("sub") String subPath, // work well
>> @javax.websocket.server.PathParam("sub") String subPath1, // work well
>> @QueryString String qs) { // work well
>>
>> return "msg:" + msg + ",last:" + last + ",path:" + subPath;
>> }
>>
>>
>
>