title: Java EE Websocket programmatic Endpoint how to use Pathparams?
body: <p>I'm fairly new to Java EE, so don't be to harsh with me, if what I'm asking doesn't make sense to you. I followed some tutorial for implementing the websocket api, essentially creating two classes. First a endpoint class looking like this:</p>
  
  <pre><code>public class ChatEndpoint extends Endpoint {
      private static final ConcurrentLinkedQueue&lt;Session&gt; peers = new ConcurrentLinkedQueue&lt;&gt;();
      private static final Logger LOGGER = Logger.getLogger(ChatEndpoint.class.getName());
  
      @Override
      public void onOpen(Session session, EndpointConfig endpointConfig) {
          LOGGER.log(Level.INFO, "New session opened");
          peers.add(session);
  
          session.addMessageHandler(new MessageHandler.Whole&lt;String&gt;() {
              @Override
              public void onMessage(String message) {
                  LOGGER.log(Level.INFO, String.format("Received message: %s", message));
                  try {
                      broadcastMessage(message, session);
                  } catch (IOException e) {
                  LOGGER.log(Level.SEVERE, null, e);
                  }
              }
          });
      }
  
      @Override
      public void onClose(Session session, CloseReason closeReason) {
          LOGGER.log(Level.INFO, String.format("Session closed with reason %s", closeReason.getReasonPhrase()));
      }
  
      public void broadcastMessage(String message, Session session) throws IOException {
          for (Session peer : peers) {
              peer.getBasicRemote().sendText(message);
          }
      }
  }
  </code></pre>
  
  <p>...and my config class:</p>
  
  <pre><code>public class ServerConfig implements ServerApplicationConfig {
      @Override
      public Set&lt;ServerEndpointConfig&gt; getEndpointConfigs(Set&lt;Class&lt;? extends Endpoint&gt;&gt; endpointClasses) {
          Set&lt;ServerEndpointConfig&gt; results = new HashSet&lt;&gt;();
  
          for (Class endpointClass : endpointClasses) {
              if (endpointClass.equals(ChatEndpoint.class)) {
                  ServerEndpointConfig serverEndpointConfig = ServerEndpointConfig.Builder.create(endpointClass, "/chat").build();
                  results.add(serverEndpointConfig);
              }
          }
          return results;
      }
  
      @Override
      public Set&lt;Class&lt;?&gt;&gt; getAnnotatedEndpointClasses(Set&lt;Class&lt;?&gt;&gt; endpointClasses) {
          return Collections.emptySet();
      }
  }
  </code></pre>
  
  <p>Now as you can see I've taken the programmatic and not the annotation way to do this. I know using the annotation way of deployment, I can specify path parameters, which I then receive in onMessage from my client. So how does this work with the a programmatic endpoint deployment?</p>