赞
踩
RequestMappingInfo.paths(prefix).build().combine(mappingInfo);
给请求增加前缀,报错Neither PathPatterns nor String patterns condition
pathPatternsCondition
为null,正常应该是前缀,那么跟踪下初始化的地方。
this.options.patternParser
不能为空。
解决办法:
public class xxxRequestMappingHandlerMapping extends RequestMappingHandlerMapping {
private RequestMappingInfo.BuilderConfiguration config = new RequestMappingInfo.BuilderConfiguration();
}
public xxxMethod(){
RequestMappingInfo info = super.getMappingForMethod(method, handlerType);
// ...
if (this.config.getPatternParser() == null) {
this.config.setPatternParser(patternParser);
}
info = RequestMappingInfo.paths(prefix)
.options(this.config)
.build()
.combine(info);
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。