类org.springframework.web.servlet.handler.RequestMatchResult源码实例Demo

下面列出了怎么用org.springframework.web.servlet.handler.RequestMatchResult的API类实例代码及写法,或者点击链接到github查看源代码。

@Override
public RequestMatchResult match(HttpServletRequest request, String pattern) {
	RequestMappingInfo info = RequestMappingInfo.paths(pattern).options(this.config).build();
	RequestMappingInfo matchingInfo = info.getMatchingCondition(request);
	if (matchingInfo == null) {
		return null;
	}
	Set<String> patterns = matchingInfo.getPatternsCondition().getPatterns();
	String lookupPath = getUrlPathHelper().getLookupPathForRequest(request, LOOKUP_PATH);
	return new RequestMatchResult(patterns.iterator().next(), lookupPath, getPathMatcher());
}
 
@Override
public RequestMatchResult match(HttpServletRequest request, String pattern) {
	RequestMappingInfo info = RequestMappingInfo.paths(pattern).options(this.config).build();
	RequestMappingInfo matchingInfo = info.getMatchingCondition(request);
	if (matchingInfo == null) {
		return null;
	}
	Set<String> patterns = matchingInfo.getPatternsCondition().getPatterns();
	String lookupPath = getUrlPathHelper().getLookupPathForRequest(request);
	return new RequestMatchResult(patterns.iterator().next(), lookupPath, getPathMatcher());
}
 
源代码3 项目: lams   文件: RequestMappingHandlerMapping.java
@Override
public RequestMatchResult match(HttpServletRequest request, String pattern) {
	RequestMappingInfo info = RequestMappingInfo.paths(pattern).options(this.config).build();
	RequestMappingInfo matchingInfo = info.getMatchingCondition(request);
	if (matchingInfo == null) {
		return null;
	}
	Set<String> patterns = matchingInfo.getPatternsCondition().getPatterns();
	String lookupPath = getUrlPathHelper().getLookupPathForRequest(request);
	return new RequestMatchResult(patterns.iterator().next(), lookupPath, getPathMatcher());
}
 
 类方法
 同包方法