All Downloads are FREE. Search and download functionalities are using the official Maven repository.

system.web.WebsocketConfigurator Maven / Gradle / Ivy

The newest version!
package system.web;

import javax.servlet.http.HttpSession;
import javax.websocket.HandshakeResponse;
import javax.websocket.server.HandshakeRequest;
import javax.websocket.server.ServerEndpointConfig;

/**
 *
 * @author wangchunzi
 */
public class WebsocketConfigurator extends ServerEndpointConfig.Configurator {

    @Override
    public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
        HttpSession s = (HttpSession) request.getHttpSession();
        sec.getUserProperties().put(HttpSession.class.getName(), s);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy