Examples of HandlerExecutionChain


Examples of org.springframework.web.servlet.HandlerExecutionChain

   * @return the HandlerExecutionChain (never <code>null</code>)
   * @see #getAdaptedInterceptors()
   */
  protected HandlerExecutionChain getHandlerExecutionChain(Object handler, HttpServletRequest request) {
    if (handler instanceof HandlerExecutionChain) {
      HandlerExecutionChain chain = (HandlerExecutionChain) handler;
      chain.addInterceptors(getAdaptedInterceptors());
      return chain;
    }
    else {
      return new HandlerExecutionChain(handler, getAdaptedInterceptors());
    }
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

    request.setContextPath("/springtravel");
    request.setServletPath("/app");
    request.setPathInfo("/flow");
    request.setRequestURI("/springtravel/app/flow");
    request.setMethod("GET");
    HandlerExecutionChain chain = mapping.getHandler(request);
    FlowHandler handler = (FlowHandler) chain.getHandler();
    assertEquals("flow", handler.getFlowId());
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

    request.setContextPath("/springtravel");
    request.setServletPath("/app");
    request.setPathInfo("/foo/flow2");
    request.setRequestURI("/springtravel/app/foo/flow2");
    request.setMethod("GET");
    HandlerExecutionChain chain = mapping.getHandler(request);
    assertNotNull(chain);
    FlowHandler handler = (FlowHandler) chain.getHandler();
    assertEquals("foo/flow2", handler.getFlowId());
    assertTrue(handler instanceof CustomFlowHandler);
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

    request.setContextPath("/springtravel");
    request.setServletPath("/app");
    request.setPathInfo("/bogus");
    request.setRequestURI("/springtravel/app/bogus");
    request.setMethod("GET");
    HandlerExecutionChain chain = mapping.getHandler(request);
    assertNull(chain);
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

   * @param request current HTTP request
   * @return the HandlerExecutionChain (never <code>null</code>)
   * @see #getAdaptedInterceptors()
   */
  protected HandlerExecutionChain getHandlerExecutionChain(Object handler, HttpServletRequest request) {
    HandlerExecutionChain chain =
      (handler instanceof HandlerExecutionChain) ?
        (HandlerExecutionChain) handler : new HandlerExecutionChain(handler);
       
    chain.addInterceptors(getAdaptedInterceptors());
   
    String lookupPath = urlPathHelper.getLookupPathForRequest(request);
    for (MappedInterceptor mappedInterceptor : mappedInterceptors) {
      if (mappedInterceptor.matches(lookupPath, pathMatcher)) {
        chain.addInterceptor(mappedInterceptor.getInterceptor());
      }
    }
   
    return chain;
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

   * @return the final handler object
   */
  protected Object buildPathExposingHandler(Object rawHandler, String bestMatchingPattern,
      String pathWithinMapping, Map<String, String> uriTemplateVariables) {

    HandlerExecutionChain chain = new HandlerExecutionChain(rawHandler);
    chain.addInterceptor(new PathExposingHandlerInterceptor(bestMatchingPattern, pathWithinMapping));
    if (!CollectionUtils.isEmpty(uriTemplateVariables)) {
      chain.addInterceptor(new UriTemplateVariablesHandlerInterceptor(uriTemplateVariables));
    }
    return chain;
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

   * @param request current HTTP request
   * @return the HandlerExecutionChain (never <code>null</code>)
   * @see #getAdaptedInterceptors()
   */
  protected HandlerExecutionChain getHandlerExecutionChain(Object handler, HttpServletRequest request) {
    HandlerExecutionChain chain =
      (handler instanceof HandlerExecutionChain) ?
        (HandlerExecutionChain) handler : new HandlerExecutionChain(handler);

    chain.addInterceptors(getAdaptedInterceptors());

    String lookupPath = urlPathHelper.getLookupPathForRequest(request);
    for (MappedInterceptor mappedInterceptor : mappedInterceptors) {
      if (mappedInterceptor.matches(lookupPath, pathMatcher)) {
        chain.addInterceptor(mappedInterceptor.getInterceptor());
      }
    }

    return chain;
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

   * @return the final handler object
   */
  protected Object buildPathExposingHandler(Object rawHandler, String bestMatchingPattern,
      String pathWithinMapping, Map<String, String> uriTemplateVariables) {

    HandlerExecutionChain chain = new HandlerExecutionChain(rawHandler);
    chain.addInterceptor(new PathExposingHandlerInterceptor(bestMatchingPattern, pathWithinMapping));
    if (!CollectionUtils.isEmpty(uriTemplateVariables)) {
      chain.addInterceptor(new UriTemplateVariablesHandlerInterceptor(uriTemplateVariables));
    }
    return chain;
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

    // Bean name or resolved handler?
    if (rawHandler instanceof String) {
      String handlerName = (String) rawHandler;
      rawHandler = getApplicationContext().getBean(handlerName);
    }
    HandlerExecutionChain chain = new HandlerExecutionChain(rawHandler);
    chain.addInterceptor(new PathExposingHandlerInterceptor(pathWithinMapping));
    return chain;
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

   * @param request current HTTP request
   * @return the HandlerExecutionChain (never <code>null</code>)
   * @see #getAdaptedInterceptors()
   */
  protected HandlerExecutionChain getHandlerExecutionChain(Object handler, HttpServletRequest request) {
    return new HandlerExecutionChain(handler, getAdaptedInterceptors());
  }
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.