Examples of HandlerExecutionChain


Examples of org.springframework.web.portlet.HandlerExecutionChain

   * @return the HandlerExecutionChain (never <code>null</code>)
   * @see #getAdaptedInterceptors()
   */
  protected HandlerExecutionChain getHandlerExecutionChain(Object handler, PortletRequest 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.portlet.HandlerExecutionChain

   * @param request current portlet request
   * @return the HandlerExecutionChain (never <code>null</code>)
   * @see #getAdaptedInterceptors()
   */
  protected HandlerExecutionChain getHandlerExecutionChain(Object handler, PortletRequest request) {
    return new HandlerExecutionChain(handler, getAdaptedInterceptors());
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

        assertNotNull(exporter);
        BeanNameUrlHandlerMapping handlerMapping = new BeanNameUrlHandlerMapping();
        handlerMapping.setApplicationContext(appContext);
        HttpServletRequest request = getRequest();

        HandlerExecutionChain chain = handlerMapping.getHandler(request);
        assertNotNull(chain);
        assertEquals(exporter, chain.getHandler());
    }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

         }
         else
         {
            requestWrapper.setInvoker(getInvoker(httpRequest));
         }
         return new HandlerExecutionChain(requestWrapper, interceptors);
      }
      catch (NotFoundException e)
      {
         if (throwNotFound)
         {
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

    /**
     * {@inheritDoc}
     */
    @Override
    protected HandlerExecutionChain getHandler(HttpServletRequest request, boolean cache) throws Exception {
        HandlerExecutionChain handlerExecutionChain = super.getHandler(request, cache);

        if (handlerExecutionChain != null) {

            buildMvc(request)
                    .setHandler(handlerExecutionChain.getHandler())
                    .setInterceptors(handlerExecutionChain.getInterceptors());
        }

        return handlerExecutionChain;
    }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

        if (object instanceof String) {
            String handlerName = (String) object;
            object = getApplicationContext().getBean(handlerName);
        }
        if (object instanceof HandlerExecutionChain) {
            HandlerExecutionChain handlerExecutionChain = (HandlerExecutionChain) object;
            object = handlerExecutionChain.getHandler();
        }

        if (object != null) {
            ServletRequestDataBinder binder = new ServletRequestDataBinder(object, "request");
            try {
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

  @Override
  protected void doDispatch(HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    HttpServletRequest processedRequest = request;
    HttpServletResponse processedResponse = response;
    HandlerExecutionChain mappedHandler = null;
    int interceptorIndex = -1;

    try {
      ModelAndView mv;
      boolean errorView = false;

      try {
        processedRequest = checkMultipart(request);
        // Determine handler for the current request.
        mappedHandler = getHandler(processedRequest);
        if (mappedHandler == null || mappedHandler.getHandler() == null) {
          noHandlerFound(processedRequest, processedResponse);
          return;
        }

        // Determine handler adapter for the current request.
        HandlerAdapter ha = getHandlerAdapter(mappedHandler.getHandler());
       
        // Widget check
        processedRequest = checkWidget(request, mappedHandler.getHandler());
        processedResponse = checkWidget(response, mappedHandler.getHandler());

                // Process last-modified header, if supported by the handler.
        String method = request.getMethod();
        boolean isGet = "GET".equals(method);
        if (isGet || "HEAD".equals(method)) {
          long lastModified = ha.getLastModified(request, mappedHandler.getHandler());
          if (logger.isDebugEnabled()) {
            String requestUri = urlPathHelper.getRequestUri(request);
            logger.debug("Last-Modified value for [" + requestUri + "] is: " + lastModified);
          }
          if (new ServletWebRequest(request, response).checkNotModified(lastModified) && isGet) {
            return;
          }
        }

        // Apply preHandle methods of registered interceptors.
        HandlerInterceptor[] interceptors = mappedHandler.getInterceptors();
        if (interceptors != null) {
          for (int i = 0; i < interceptors.length; i++) {
            HandlerInterceptor interceptor = interceptors[i];
            if (!interceptor.preHandle(processedRequest, processedResponse, mappedHandler.getHandler())) {
              triggerAfterCompletion(mappedHandler, interceptorIndex, processedRequest, response, null);
              return;
            }
            interceptorIndex = i;
          }
        }

        // Actually invoke the handler.
        mv = ha.handle(processedRequest, response, mappedHandler.getHandler());

        // Do we need view name translation?
        if (mv != null && !mv.hasView()) {
          mv.setViewName(getDefaultViewName(request));
        }

        // Apply postHandle methods of registered interceptors.
        if (interceptors != null) {
          for (int i = interceptors.length - 1; i >= 0; i--) {
            HandlerInterceptor interceptor = interceptors[i];
            interceptor.postHandle(processedRequest, processedResponse, mappedHandler.getHandler(), mv);
          }
        }
      }
      catch (ModelAndViewDefiningException ex) {
        logger.debug("ModelAndViewDefiningException encountered", ex);
        mv = ex.getModelAndView();
      }
      catch (Exception ex) {
        Object handler = (mappedHandler != null ? mappedHandler.getHandler() : null);
        mv = processHandlerException(processedRequest, processedResponse, handler, ex);
        errorView = (mv != null);
      }

      // Did the handler return a view to render?
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

        if (object instanceof String) {
            String handlerName = (String) object;
            object = getApplicationContext().getBean(handlerName);
        }
        if (object instanceof HandlerExecutionChain) {
            HandlerExecutionChain handlerExecutionChain = (HandlerExecutionChain) object;
            object = handlerExecutionChain.getHandler();
        }
       
        if (object != null) {
          // prevent CSRF attacks
          if (object instanceof DestinationFacade) {
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

        if (object instanceof String) {
            String handlerName = (String) object;
            object = getApplicationContext().getBean(handlerName);
        }
        if (object instanceof HandlerExecutionChain) {
            HandlerExecutionChain handlerExecutionChain = (HandlerExecutionChain) object;
            object = handlerExecutionChain.getHandler();
        }
       
        if (object != null) {
          // prevent CSRF attacks
          if (object instanceof DestinationFacade) {
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
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.