diff --git a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/beans/DateTextSocket.java b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/beans/DateTextSocket.java index 07644d017ca..68674b14a2d 100644 --- a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/beans/DateTextSocket.java +++ b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/samples/beans/DateTextSocket.java @@ -32,8 +32,7 @@ import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.websocket.jsr356.server.StackUtil; -@ServerEndpoint(value = "/echo/beans/date", decoders = -{ DateDecoder.class }) +@ServerEndpoint(value = "/echo/beans/date", decoders = { DateDecoder.class }, encoders = { DateEncoder.class }) public class DateTextSocket { private static final Logger LOG = Log.getLogger(DateTextSocket.class); @@ -46,6 +45,7 @@ public class DateTextSocket this.session = session; } + // The decoder declared in the @ServerEndpoint will be used @OnMessage public void onMessage(Date d) throws IOException { @@ -56,6 +56,7 @@ public class DateTextSocket else { String msg = SimpleDateFormat.getDateInstance(SimpleDateFormat.SHORT).format(d); + // The encoder declared in the @ServerEndpoint will be used session.getAsyncRemote().sendText(msg); } }