O'Reilly logo

Java EE 7 Developer Handbook by Peter A. Pilgrim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Server-side Java WebSockets

In Java EE 7, the Java package javax.websocket is the root for WebSockets. There is one package underneath this one for server endpoints: javax.websocket.server.

The server-side endpoint in Java represents one end of the peers. Java applications with WebSocket endpoints are created through programming directly against the library. Otherwise, the endpoints are determined by annotations in the JSR 356 specification.

The annotation javax.websocket.server.ServerEndpoint is applied to classes that execute an endpoint on the server. The annotation requires a URL pattern fragment similar to the Servlet 3.1 annotation @javax.servlet.WebServlet, which determines how the implementation provider routes an incoming WebSockets request ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required