use of cn.taketoday.web.util.pattern.PathMatchInfo in project today-infrastructure by TAKETODAY.
the class HandlerMatchingMetadata method getPathMatchInfo.
public PathMatchInfo getPathMatchInfo() {
PathMatchInfo pathMatchInfo = this.pathMatchInfo;
if (pathMatchInfo == null) {
pathMatchInfo = getBestMatchingPattern().matchAndExtract(requestPath);
if (pathMatchInfo == null) {
pathMatchInfo = PathMatchInfo.EMPTY;
}
this.pathMatchInfo = pathMatchInfo;
}
return pathMatchInfo;
}
use of cn.taketoday.web.util.pattern.PathMatchInfo in project today-framework by TAKETODAY.
the class HandlerMatchingMetadata method getPathMatchInfo.
public PathMatchInfo getPathMatchInfo() {
PathMatchInfo pathMatchInfo = this.pathMatchInfo;
if (pathMatchInfo == null) {
pathMatchInfo = getBestMatchingPattern().matchAndExtract(requestPath);
if (pathMatchInfo == null) {
pathMatchInfo = PathMatchInfo.EMPTY;
}
this.pathMatchInfo = pathMatchInfo;
}
return pathMatchInfo;
}
use of cn.taketoday.web.util.pattern.PathMatchInfo in project today-framework by TAKETODAY.
the class AnnotationWebSocketDispatcher method afterHandshake.
@Override
public void afterHandshake(RequestContext context, WebSocketSession session) throws Throwable {
context.setAttribute(WebSocketSession.WEBSOCKET_SESSION_KEY, session);
// invoke after handshake callback
socketHandler.afterHandshake(context);
if (socketHandler.containsPathVariable) {
// for path variables handling
PathPattern pathPattern = socketHandler.pathPattern;
RequestPath parsedRequestPath = context.getLookupPath();
PathMatchInfo pathMatchInfo = pathPattern.matchAndExtract(parsedRequestPath);
Assert.state(pathMatchInfo != null, "Path match error");
Map<String, String> uriVariables = pathMatchInfo.getUriVariables();
session.setAttribute(WebSocketSession.URI_TEMPLATE_VARIABLES, uriVariables);
}
}
use of cn.taketoday.web.util.pattern.PathMatchInfo in project today-infrastructure by TAKETODAY.
the class AnnotationWebSocketDispatcher method afterHandshake.
@Override
public void afterHandshake(RequestContext context, WebSocketSession session) throws Throwable {
context.setAttribute(WebSocketSession.WEBSOCKET_SESSION_KEY, session);
// invoke after handshake callback
socketHandler.afterHandshake(context);
if (socketHandler.containsPathVariable) {
// for path variables handling
PathPattern pathPattern = socketHandler.pathPattern;
RequestPath parsedRequestPath = context.getLookupPath();
PathMatchInfo pathMatchInfo = pathPattern.matchAndExtract(parsedRequestPath);
Assert.state(pathMatchInfo != null, "Path match error");
Map<String, String> uriVariables = pathMatchInfo.getUriVariables();
session.setAttribute(WebSocketSession.URI_TEMPLATE_VARIABLES, uriVariables);
}
}
Aggregations