title: How to read the json request from Websocket subscriber(client) at Javax.websocket?
body: <p>The below is my Websocket subscription code.</p>
  
  <p>Client side:</p>
  
  <pre><code>var request = '{"sessionId": "_fjuhdf896786767", "username":"admin", "status":true}'
  ws = new WebSocket(wsUri);
  console.log("registered");
      ws.onopen = function() {
          console.log("connection opened!")
          ws.send(request);
      }
  
      ws.onmessage = function(msg) {
          console.log("received message:");
          window.getData(JSON.parse(msg.data));
      }
  </code></pre>
  
  <p>At server side, the implementioation of websocket is below:</p>
  
  <pre><code>@ServerEndPoint(value="/status")
  public class WebsocketServer {
  
      @OnOpen
      public void OpenMsg(Session session, EndpointConfig cnfg) {
  
          String retdata = "";
          try {
              if (session.isOpen()) {
                  log.info("OpenMsg() payload req data from client"  + decoder);
                  retdata = getCount(decoder);
                  log.info("OpenMsg() retdata " + retdata);
                  session.getBasicRemote().sendText(retdata.toString());
                  try {
                    Thread.sleep(pollinterval);
                  } catch (InterruptedException e) {
                      e.printStackTrace();
                  }
              }
          } catch (IOException e) {
              try {
                  session.close();
                  log.error("Exception occured while Opening WS Session");
                  e.printStackTrace();
              } catch (IOException e1) {
                  // Ignore
              }
          }
  
      }                   
  }
  </code></pre>
  
  <p>I would like to know how to read the json request string from "ws.send(request);" at the server side(javax.websocket).
    I saw Encoder and Decoder, but in this case i am only sending the json request as a string which is not encoded as shown above.
    Could any body tell me, how to read json string as a payload in Javax.websocket. </p>