samedi 28 mars 2015

@ServerEndpoint and @Autowired

How can I autowire a field into a @ServerEndpoint. The following does not work.



@Component
@ServerEndpoint("/ws")
public class MyWebSocket {
@Autowired
private ObjectMapper objectMapper;
}


However if I remove the @ServerEndpoint, it works fine.


I am using spring 3.2.1 and Java 7


Aucun commentaire:

Enregistrer un commentaire