Examples of FlashMapManager


Examples of org.springframework.web.servlet.FlashMapManager

      UriComponents uriComponents = UriComponentsBuilder.fromUriString(targetUrl).build();
      flashMap.setTargetRequestPath(uriComponents.getPath());
      flashMap.addTargetRequestParams(uriComponents.getQueryParams());
    }

    FlashMapManager flashMapManager = RequestContextUtils.getFlashMapManager(request);
    flashMapManager.saveOutputFlashMap(flashMap, request, response);

    sendRedirect(request, response, targetUrl, this.http10Compatible);
  }
View Full Code Here

Examples of org.springframework.web.servlet.FlashMapManager

    }

    FlashMap flashMap = new FlashMap();
    flashMap.putAll(this.flashAttributes);

    FlashMapManager flashMapManager = getFlashMapManager(request);
    flashMapManager.saveOutputFlashMap(flashMap, request, new MockHttpServletResponse());

    // Apply post-processors at the very end

    for (RequestPostProcessor postProcessor : this.postProcessors) {
      request = postProcessor.postProcessRequest(request);
View Full Code Here

Examples of org.springframework.web.servlet.FlashMapManager

    request.setPathInfo(this.pathInfo);
  }

  private FlashMapManager getFlashMapManager(MockHttpServletRequest request) {
    FlashMapManager flashMapManager = null;
    try {
      ServletContext servletContext = request.getServletContext();
      WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
      flashMapManager = wac.getBean(DispatcherServlet.FLASH_MAP_MANAGER_BEAN_NAME, FlashMapManager.class);
    }
View Full Code Here

Examples of org.springframework.web.servlet.FlashMapManager

    if ((result == null) || (result.getOutcome() == null) || (result.getOutcome().getOutput().isEmpty())) {
      return;
    }
    AttributeMap<Object> output = result.getOutcome().getOutput();

    FlashMapManager flashMapManager = RequestContextUtils.getFlashMapManager(request);
    if (flashMapManager == null) {
      return;
    }

    UriComponents uriComponents = UriComponentsBuilder.fromUriString(location).build();
    FlashMap flashMap = new FlashMap();
    flashMap.setTargetRequestPath(uriComponents.getPath());
    flashMap.addTargetRequestParams(uriComponents.getQueryParams());
    flashMap.putAll(output.asMap());
    flashMapManager.saveOutputFlashMap(flashMap, request, response);
  }
View Full Code Here

Examples of org.springframework.web.servlet.FlashMapManager

    FlashMap flashMap = RequestContextUtils.getOutputFlashMap(request);
    if (!CollectionUtils.isEmpty(flashMap)) {
      UriComponents uriComponents = UriComponentsBuilder.fromUriString(targetUrl).build();
      flashMap.setTargetRequestPath(uriComponents.getPath());
      flashMap.addTargetRequestParams(uriComponents.getQueryParams());
      FlashMapManager flashMapManager = RequestContextUtils.getFlashMapManager(request);
      if (flashMapManager == null) {
        throw new IllegalStateException("FlashMapManager not found despite output FlashMap having been set");
      }
      flashMapManager.saveOutputFlashMap(flashMap, request, response);
    }

    sendRedirect(request, response, targetUrl, this.http10Compatible);
  }
View Full Code Here

Examples of org.springframework.web.servlet.FlashMapManager

      given(request.getContextPath()).willReturn("/context");
    }

    given(request.getAttribute(DispatcherServlet.OUTPUT_FLASH_MAP_ATTRIBUTE)).willReturn(new FlashMap());

    FlashMapManager flashMapManager = new SessionFlashMapManager();
    given(request.getAttribute(DispatcherServlet.FLASH_MAP_MANAGER_ATTRIBUTE)).willReturn(flashMapManager);

    HttpServletResponse response = mock(HttpServletResponse.class, "response");
    given(response.encodeRedirectURL(expectedUrlForEncoding)).willReturn(expectedUrlForEncoding);
    response.sendRedirect(expectedUrlForEncoding);
View Full Code Here

Examples of org.springframework.web.servlet.FlashMapManager

    }

    FlashMap flashMap = new FlashMap();
    flashMap.putAll(this.flashAttributes);

    FlashMapManager flashMapManager = getFlashMapManager(request);
    flashMapManager.saveOutputFlashMap(flashMap, request, new MockHttpServletResponse());

    request.setAsyncSupported(true);

    return request;
  }
View Full Code Here

Examples of org.springframework.web.servlet.FlashMapManager

    }
    request.setPathInfo(this.pathInfo);
  }

  private FlashMapManager getFlashMapManager(MockHttpServletRequest request) {
    FlashMapManager flashMapManager = null;
    try {
      ServletContext servletContext = request.getServletContext();
      WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
      flashMapManager = wac.getBean(DispatcherServlet.FLASH_MAP_MANAGER_BEAN_NAME, FlashMapManager.class);
    }
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.