Package org.springframework.web.method

Examples of org.springframework.web.method.HandlerMethod


    if (methodInfo != null && methodInfo.getForwardPath() != null) {
      return methodInfo.getForwardPath();
    } else if (methodInfo != null && methodInfo.getHandlerMethod() != null) {
      streamResponse = configuration.isStreamResponse() || methodInfo.isStreamResponse();

      HandlerMethod handlerMethod = methodInfo.getHandlerMethod();
      try {

        ModelAndView modelAndView = null;

        if (configuration.isSynchronizeOnSession() || methodInfo.isSynchronizeOnSession()) {
View Full Code Here


  @Override
  public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {

    if (handler instanceof HandlerMethod) {
      HandlerMethod handlerMethod = HandlerMethod.class.cast(handler);
      if (shouldIntercept(handlerMethod)) {
        return preHandleInternal(request, response, handlerMethod);
      }
    }
    return true;
View Full Code Here

  @Override
  public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {

    if (modelAndView != null && !isRedirect(modelAndView) && handler instanceof HandlerMethod) {
      HandlerMethod handlerMethod = HandlerMethod.class.cast(handler);
      if (shouldIntercept(handlerMethod)) {

        @SuppressWarnings({ "rawtypes", "unchecked" })
        Map<String, ?> pathVariables = (Map) request.getAttribute(View.PATH_VARIABLES);
        postHandleInternal(request, response, handlerMethod, modelAndView, pathVariables);
View Full Code Here

  @Override
  public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {

    if (handler instanceof HandlerMethod) {
      HandlerMethod handlerMethod = HandlerMethod.class.cast(handler);
      if (shouldIntercept(handlerMethod)) {
        afterCompletionInternal(request, response, handlerMethod, ex);
      }
    }
  }
View Full Code Here

            path = path.substring(1, path.length());
          }
          this.forwardPath = "forward:" + path;
        }
      } else {
        this.handlerMethod = new HandlerMethod(beanName, context, method).createWithResolvedBean();
      }
    }

    switch (type) {
    case SIMPLE:
View Full Code Here

    if (methodInfo != null && methodInfo.getForwardPath() != null) {
      return methodInfo.getForwardPath();
    } else if (methodInfo != null && methodInfo.getHandlerMethod() != null) {
      streamResponse = configuration.isStreamResponse() || methodInfo.isStreamResponse();

      HandlerMethod handlerMethod = methodInfo.getHandlerMethod();
      try {

        ModelAndView modelAndView = null;

        if (configuration.isSynchronizeOnSession() || methodInfo.isSynchronizeOnSession()) {
View Full Code Here

        pluginHandlerMethods.clear();
        //We should update Web plugins before resolving handler
        pluginLoader.reloadPlugins(new TypeFilter(WebControllerPlugin.class));
        String lookupPath = getUrlPathHelper().getLookupPathForRequest(request);
        MethodAwareKey key = new MethodAwareKey(RequestMethod.valueOf(request.getMethod()), getUniformUrl(lookupPath));
        HandlerMethod handlerMethod = pluginHandlerMethods.get(key);
        if (handlerMethod != null) {
            return handlerMethod;
        } else {
            return super.getHandlerInternal(request);
        }
View Full Code Here

    // Just get patterns from the method @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

  public void looksUpRepositoryEntityControllerMethodCorrectly() throws Exception {

    when(mappings.exportsTopLevelResourceFor("people")).thenReturn(true);
    mockRequest = new MockHttpServletRequest("GET", "/people");

    HandlerMethod method = handlerMapping.lookupHandlerMethod("/people", mockRequest);

    assertThat(method, is(notNullValue()));
    assertThat(method.getMethod(), is(listEntitiesMethod));
  }
View Full Code Here

    when(mappings.exportsTopLevelResourceFor("people")).thenReturn(true);
    mockRequest = new MockHttpServletRequest("GET", "/base/people");

    configuration.setBaseUri(URI.create("base"));

    HandlerMethod method = handlerMapping.lookupHandlerMethod("/base/people", mockRequest);

    assertThat(method, is(notNullValue()));
    assertThat(method.getMethod(), is(listEntitiesMethod));
  }
View Full Code Here

TOP

Related Classes of org.springframework.web.method.HandlerMethod

Copyright © 2018 www.massapicom. 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.