如何使用JEE7 Websockets将参数传递给@OnOpen方法,
2022-09-03 00:17:21
我有此代码
@ServerEndpoint(value = "/websocket")
public class Service {
private String clientId;
@OnOpen
public void init(Session session) throws IOException {
//opening a websocket
// get clientId
clientId = // Code here to get initialization parameter.
}
}
如何从打开套接字的客户端获取初始化参数?