UriComponents uriComponents = applyContributors(builder, method, argumentValues);
return ServletUriComponentsBuilder.newInstance().uriComponents(uriComponents);
}
private static String getMethodRequestMapping(Method method) {
RequestMapping annot = AnnotationUtils.findAnnotation(method, RequestMapping.class);
if (annot == null) {
throw new IllegalArgumentException("No @RequestMapping on: " + method.toGenericString());
}
if (ObjectUtils.isEmpty(annot.value()) || StringUtils.isEmpty(annot.value()[0])) {
return "/";
}
if (annot.value().length > 1 && logger.isWarnEnabled()) {
logger.warn("Multiple paths on method " + method.toGenericString() + ", using first one");
}
return annot.value()[0];
}