diff --git a/docs/src/main/asciidoc/websockets.adoc b/docs/src/main/asciidoc/websockets.adoc index 1328aeaacbd4e..25f0b1e136e88 100644 --- a/docs/src/main/asciidoc/websockets.adoc +++ b/docs/src/main/asciidoc/websockets.adoc @@ -102,7 +102,6 @@ public class ChatSocket { @OnOpen public void onOpen(Session session, @PathParam("username") String username) { sessions.put(username, session); - broadcast("User " + username + " joined"); } @OnClose @@ -119,7 +118,11 @@ public class ChatSocket { @OnMessage public void onMessage(String message, @PathParam("username") String username) { - broadcast(">> " + username + ": " + message); + if (message.equalsIgnoreCase("_ready_")) { + broadcast("User " + username + " joined"); + } else { + broadcast(">> " + username + ": " + message); + } } private void broadcast(String message) {