title: Jetty Websocket with Spring IOC
body: <p>I am trying to develop a web-socket based application using jetty. I also want to use spring for IOC. </p>
  
  <p>Below is my code</p>
  
  <pre><code>Server server = new Server(8080);
  
  AnnotationConfigWebApplicationContext annotationContext = new AnnotationConfigWebApplicationContext();
  annotationContext.setConfigLocation("com.test.config");
  
  ServletContextHandler contextHandler = new ServletContextHandler();
  contextHandler.setErrorHandler(null);
  contextHandler.setContextPath("/");
  
  contextHandler.addServlet(TestWebsocketServlet.class, "/");
  contextHandler.addEventListener(new ContextLoaderListener(annotationContext));
  contextHandler.setInitParameter( "contextClass", AnnotationConfigWebApplicationContext.class.getName() );
  contextHandler.setInitParameter( "contextConfigLocation", AppConfig.class.getName() );
  server.setHandler(contextHandler);
  </code></pre>
  
  <p>I am not able to autowire my spring dependency in my TestWebsocketServlet class. Please suggest</p>