Discussion:
how to use custom injection annotation
(too old to reply)
张立鑫
2014-09-21 15:57:20 UTC
Permalink
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;
}

Loading...