我可以使用以下代码解决此问题。
AntPathMatcher是识别属性文件中配置的传入请求和URL是否完全匹配的完美方法。该解决方案对我来说很有用。
AntPathMatcher springMatcher = new AntPathMatcher();Optional<String> antMatch = props.getMapping().stream() .filter(//Perform Some Filter as per need) .map(Mapping::getVersion) .findFirst();return antMatch.isPresent() ? antMatch.get() : null;



