title: Accessing ServletContext and HttpSession in @OnMessage of a JSR-356 @ServerEndpoint
body: <p>I need to get the <code>ServletContext</code> from inside a <code>@ServerEndpoint</code> in order to find Spring <code>ApplicationContext</code> and lookup for a Bean.</p>
  
  <p>For the moment my best approach is to bind that bean in the JNDI naming context and lookup it in the <code>Endpoint</code>. Any better solution is welcome.</p>
  
  <p>I'm also looking for a reasonable way to sync servlet's <code>HttpSession</code> with websocket's <code>Session</code>.</p>