Examples of RequestMapping


Examples of org.springframework.web.bind.annotation.RequestMapping

    return ServletUriComponentsBuilder.fromCurrentServletMapping().path(mapping);
  }

  private static String getTypeRequestMapping(Class<?> controllerType) {
    Assert.notNull(controllerType, "'controllerType' must not be null");
    RequestMapping annot = AnnotationUtils.findAnnotation(controllerType, RequestMapping.class);
    if (annot == null || ObjectUtils.isEmpty(annot.value()) || StringUtils.isEmpty(annot.value()[0])) {
      return "/";
    }
    if (annot.value().length > 1 && logger.isWarnEnabled()) {
      logger.warn("Multiple paths on controller " + controllerType.getName() + ", using first one");
    }
    return annot.value()[0];
  }
View Full Code Here

Examples of org.springframework.web.bind.annotation.RequestMapping

    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];
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.