title: Spring-Boot without STOMP (raw websocket)
body: <p><strong>Edit: Please do not downvote without leaving at least a comment.</strong></p>
  
  <p>I'd like to implement websocket in a SpringBoot application without Message Broker and STOMP. However, I need to access Spring Beans (repositories and services).</p>
  
  <p>The <a href="http://www.baeldung.com/java-websockets" rel="nofollow noreferrer">Java API</a> is so simple that I can't understand why Spring made it so complex. </p>
  
  <p>Here's what I need:</p>
  
  <p>I need to implement a websocket endpoint with dynamic URI so I can use <code>@PathParam</code> like this:</p>
  
  <pre><code>@ServerEndpoint(value = "/chat/{username}")
  public class wsEndpoint
  </code></pre>
  
  <p>Using <code>@EnableWebSocket</code> with <code>WebSocketConfigurer</code> and <code>TextWebSocketHandler</code> only allows me to implement static endpoints.</p>
  
  <p>The alternative recommended by <a href="https://spring.io/guides/gs/messaging-stomp-websocket/" rel="nofollow noreferrer">Spring documentation</a> is to implement Message Brokers and STOMP, which makes usage (IMHO) unnecessarily complex for most cases.</p>
  
  <p>I really would like to use <code>@EnableWebSocket</code> with <code>WebSocketConfigurer</code>,  <code>TextWebSocketHandler</code> and dynamic URIs. Is there a way to do so?</p>