Examples of RequestMapping


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

        }
      }
    } else {
      if (method.getReturnType().equals(Void.TYPE)) {

        RequestMapping methodAnnotation = AnnotationUtils.findAnnotation(method, RequestMapping.class);
        RequestMapping classAnnotation = AnnotationUtils.findAnnotation(clazz, RequestMapping.class);

        String path = null;
        if (hasValue(classAnnotation)) {
          path = classAnnotation.value()[0];
        }

        if (hasValue(methodAnnotation)) {
          String methodPath = methodAnnotation.value()[0];
          if (path != null) {
View Full Code Here

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

          }
        }
      }

    } else {
      RequestMapping methodAnnotation = AnnotationUtils.findAnnotation(method, RequestMapping.class);
      if (methodAnnotation != null) {

        RequestMapping classAnnotation = AnnotationUtils.findAnnotation(clazz, RequestMapping.class);

        String path = null;
        if (hasValue(classAnnotation)) {
          path = classAnnotation.value()[0];
        }

        if (hasValue(methodAnnotation)) {
          String methodPath = methodAnnotation.value()[0];
          if (path != null) {
View Full Code Here

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

        }
      }
    } else {
      if (method.getReturnType().equals(Void.TYPE)) {

        RequestMapping methodAnnotation = AnnotationUtils.findAnnotation(method, RequestMapping.class);
        RequestMapping classAnnotation = AnnotationUtils.findAnnotation(clazz, RequestMapping.class);

        String path = null;
        if (hasValue(classAnnotation)) {
          path = classAnnotation.value()[0];
        }

        if (hasValue(methodAnnotation)) {
          String methodPath = methodAnnotation.value()[0];
          if (path != null) {
View Full Code Here

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

    // In the real implementation AbstractHandlerMethodMapping.handleMatch
    // should to expose the mapping info to a request attribute

    if (handler instanceof HandlerMethod) {
      HandlerMethod handlerMethod = (HandlerMethod) handler;
      RequestMapping rm = handlerMethod.getMethodAnnotation(RequestMapping.class);
      return Arrays.asList(rm.value());
    }

    return Collections.emptyList();
  }
View Full Code Here

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

        return "redirect:" + backURL;
    }

    protected String defaultViewPrefix() {
        String currentViewPrefix = "";
        RequestMapping requestMapping = AnnotationUtils.findAnnotation(getClass(), RequestMapping.class);
        if (requestMapping != null && requestMapping.value().length > 0) {
            currentViewPrefix = requestMapping.value()[0];
        }

        if (StringUtils.isEmpty(currentViewPrefix)) {
            currentViewPrefix = this.entityClass.getSimpleName();
        }
View Full Code Here

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

  @Test
  public void testResolveArgument() throws Exception {

    MethodParameter mock2 = mock(MethodParameter.class);
    RequestMapping requestMapping = mock(RequestMapping.class);
    when(mock2.getMethodAnnotation(RequestMapping.class)).thenReturn(requestMapping);
    when(requestMapping.value()).thenReturn(new String[] { "/list/**" });
    final RequestMapping requestMappingOnType = mock(RequestMapping.class);
    when(requestMappingOnType.value()).thenReturn(new String[] { "/script" });
    RemainedPathMethodArgumentResolver resolver = new RemainedPathMethodArgumentResolver() {
      @Override
      protected RequestMapping getDeclaringClassRequestMapping(MethodParameter parameter) {
        return requestMappingOnType;
      }
View Full Code Here

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

   */
  @Override
  public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
          NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
    AntPathMatcher pathMatcher = new AntPathMatcher();
    RequestMapping requestMappingOnMethod = parameter.getMethodAnnotation(RequestMapping.class);
    RequestMapping requestMappingOnClass = getDeclaringClassRequestMapping(parameter);
    String combine = pathMatcher.combine(requestMappingOnClass.value()[0], requestMappingOnMethod.value()[0]);
    return PathUtils.removePrependedSlash(pathMatcher.extractPathWithinPattern(combine, (String) webRequest
        .getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE,
            NativeWebRequest.SCOPE_REQUEST)));
  }
View Full Code Here

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

          }
          ActionMapping actionMapping = AnnotationUtils.findAnnotation(method, ActionMapping.class);
          RenderMapping renderMapping = AnnotationUtils.findAnnotation(method, RenderMapping.class);
          ResourceMapping resourceMapping = AnnotationUtils.findAnnotation(method, ResourceMapping.class);
          EventMapping eventMapping = AnnotationUtils.findAnnotation(method, EventMapping.class);
          RequestMapping requestMapping = AnnotationUtils.findAnnotation(method, RequestMapping.class);
          if (actionMapping != null) {
            params = StringUtils.mergeStringArrays(params, actionMapping.params());
            predicate = new ActionMappingPredicate(actionMapping.value(), params);
          }
          else if (renderMapping != null) {
            params = StringUtils.mergeStringArrays(params, renderMapping.params());
            predicate = new RenderMappingPredicate(renderMapping.value(), params);
          }
          else if (resourceMapping != null) {
            predicate = new ResourceMappingPredicate(resourceMapping.value());
          }
          else if (eventMapping != null) {
            predicate = new EventMappingPredicate(eventMapping.value());
          }
          if (requestMapping != null) {
            modeKeys = requestMapping.value();
            if (typeMapping != null) {
              if (!PortletAnnotationMappingUtils.validateModeMapping(modeKeys, typeMapping.value())) {
                throw new IllegalStateException("Mode mappings conflict between method and type level: " +
                    Arrays.asList(modeKeys) + " versus " + Arrays.asList(typeMapping.value()));
              }
            }
            params = StringUtils.mergeStringArrays(params, requestMapping.params());
            if (predicate == null) {
              predicate = new MethodLevelMappingPredicate(params);
            }
          }
          if (predicate != null) {
View Full Code Here

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

   * @see #getCustomTypeCondition(Class)
   */
  @Override
  protected RequestMappingInfo getMappingForMethod(Method method, Class<?> handlerType) {
    RequestMappingInfo info = null;
    RequestMapping methodAnnotation = AnnotationUtils.findAnnotation(method, RequestMapping.class);
    if (methodAnnotation != null) {
      RequestCondition<?> methodCondition = getCustomMethodCondition(method);
      info = createRequestMappingInfo(methodAnnotation, methodCondition);
      RequestMapping typeAnnotation = AnnotationUtils.findAnnotation(handlerType, RequestMapping.class);
      if (typeAnnotation != null) {
        RequestCondition<?> typeCondition = getCustomTypeCondition(handlerType);
        info = createRequestMappingInfo(typeAnnotation, typeCondition).combine(info);
      }
    }
View Full Code Here

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

      RequestMappingInfo mappingInfo = new RequestMappingInfo();
      ActionMapping actionMapping = AnnotationUtils.findAnnotation(method, ActionMapping.class);
      RenderMapping renderMapping = AnnotationUtils.findAnnotation(method, RenderMapping.class);
      ResourceMapping resourceMapping = AnnotationUtils.findAnnotation(method, ResourceMapping.class);
      EventMapping eventMapping = AnnotationUtils.findAnnotation(method, EventMapping.class);
      RequestMapping requestMapping = AnnotationUtils.findAnnotation(method, RequestMapping.class);
      if (actionMapping != null) {
        mappingInfo.initPhaseMapping(PortletRequest.ACTION_PHASE, actionMapping.value(), actionMapping.params());
      }
      if (renderMapping != null) {
        mappingInfo.initPhaseMapping(PortletRequest.RENDER_PHASE, renderMapping.value(), renderMapping.params());
      }
      if (resourceMapping != null) {
        mappingInfo.initPhaseMapping(PortletRequest.RESOURCE_PHASE, resourceMapping.value(), new String[0]);
      }
      if (eventMapping != null) {
        mappingInfo.initPhaseMapping(PortletRequest.EVENT_PHASE, eventMapping.value(), new String[0]);
      }
      if (requestMapping != null) {
        mappingInfo.initStandardMapping(requestMapping.value(), requestMapping.method(),
            requestMapping.params(), requestMapping.headers());
        if (mappingInfo.phase == null) {
          mappingInfo.phase = determineDefaultPhase(method);
        }
      }
      if (mappingInfo.phase != null) {
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.