package com.wyu.online.base;

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

/**
 *
 * Created by Administrator on  2018/7/16
 */
public class BaseContext extends ServerEndpointConfig.Configurator {

    @Override
    public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
        HttpSession httpSession = (HttpSession) request.getHttpSession();
        ServletContext servletContext =  httpSession.getServletContext();

        sec.getUserProperties().put(HttpSession.class.getName(),httpSession);
        sec.getUserProperties().put(ServletContext.class.getName(),servletContext);
    }
}
最近下载更多
敏哥gege  LV43 2024年12月15日
hongdongdong  LV14 2023年12月2日
li246520  LV2 2023年6月26日
流连瓦盖法  LV7 2023年6月25日
yjhusst  LV1 2022年11月26日
云翳tel青  LV11 2022年11月19日
cx0127  LV13 2022年10月30日
1535316910  LV7 2022年6月16日
y1214435276  LV9 2022年5月14日
weilaizhisheng  LV21 2022年3月14日
最近浏览更多
ChanLain  LV2 2月19日
敏哥gege  LV43 2024年12月15日
zolscy  LV24 2024年11月29日
123456cjj  LV1 2024年6月2日
_69860161  LV1 2024年5月9日
pokerf  LV5 2024年4月7日
好的好的  LV8 2024年3月4日
auqfnifc  LV3 2024年2月7日
asddwh  LV13 2023年12月29日
WBelong  LV8 2023年12月27日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友