.getServletContext().getAttribute(
"javax.websocket.server.ServerContainer");
try {
final URI myUrl = URI.create(sce.getServletContext()
.getInitParameter("servletUrl"));
final ServerEndpointConfig config = ServerEndpointConfig.Builder
.create(WebsocketEndpoint.class, myUrl.getPath()).build();
config.getUserProperties().put("servletUrl", myUrl);
serverContainer.addEndpoint(config);
} catch (final DeploymentException e) {
LOG.log(Level.WARNING,
"Couldn't initialize websocket server endpoint.", e);
}