title: @ServerEndpoint and @Autowired
body: <p>How can I autowire a field into a @ServerEndpoint. The following does not work.</p>
  
  <pre><code>@Component
  @ServerEndpoint("/ws")
  public class MyWebSocket {   
      @Autowired
      private ObjectMapper objectMapper;
  }
  </code></pre>
  
  <p>However if I remove the <code>@ServerEndpoint</code>, it works fine.</p>
  
  <p>I am using spring 3.2.1 and Java 7</p>