public class HandshakeInterceptor extends HttpSessionHandshakeInterceptor {
@Override
public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception {
String path = request.getURI().getPath();
Long matricule = Long.parseLong(path.substring(path.lastIndexOf('/') + 1));
attributes.put("matricule", matricule);
return super.beforeHandshake(request, response, wsHandler, attributes);
}
}
public class HandshakeInterceptor extends HttpSessionHandshakeInterceptor {
@Override
public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception {
String path = request.getURI().getPath();
Long matricule = Long.parseLong(path.substring(path.lastIndexOf('/') + 1));
attributes.put("matricule", matricule);
return super.beforeHandshake(request, response, wsHandler, attributes);
}
}