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:26:48 +0200

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;
> }
>
>