Examples of SessionFlashMapManager


Examples of org.springframework.web.servlet.support.SessionFlashMapManager

  @Test
  public void flashAttribute() throws Exception {
    this.builder.flashAttr("foo", "bar");
    MockHttpServletRequest request = this.builder.buildRequest(this.servletContext);

    FlashMap flashMap = new SessionFlashMapManager().retrieveAndUpdate(request, null);
    assertNotNull(flashMap);
    assertEquals("bar", flashMap.get("foo"));
  }
View Full Code Here

Examples of org.springframework.web.servlet.support.SessionFlashMapManager

    }
    catch (IllegalStateException ex) {
    }
    catch (NoSuchBeanDefinitionException ex) {
    }
    return (flashMapManager != null) ? flashMapManager : new SessionFlashMapManager();
  }
View Full Code Here

Examples of org.springframework.web.servlet.support.SessionFlashMapManager

    rv.setUrl("http://url.somewhere.com");
    rv.setHttp10Compatible(false);
    MockHttpServletRequest request = createRequest();
    MockHttpServletResponse response = new MockHttpServletResponse();
    request.setAttribute(DispatcherServlet.OUTPUT_FLASH_MAP_ATTRIBUTE, new FlashMap());
    request.setAttribute(DispatcherServlet.FLASH_MAP_MANAGER_ATTRIBUTE, new SessionFlashMapManager());
    rv.render(new HashMap<String, Object>(), request, response);
    assertEquals(303, response.getStatus());
    assertEquals("http://url.somewhere.com", response.getHeader("Location"));
  }
View Full Code Here

Examples of org.springframework.web.servlet.support.SessionFlashMapManager

  }

  private MockHttpServletRequest createRequest() {
    MockHttpServletRequest request = new MockHttpServletRequest();
    request.setAttribute(DispatcherServlet.OUTPUT_FLASH_MAP_ATTRIBUTE, new FlashMap());
    request.setAttribute(DispatcherServlet.FLASH_MAP_MANAGER_ATTRIBUTE, new SessionFlashMapManager());
    return request;
  }
View Full Code Here

Examples of org.springframework.web.servlet.support.SessionFlashMapManager

      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.support.SessionFlashMapManager

  @Before
  public void setUp() {
    this.request = new MockHttpServletRequest();
    this.response = new MockHttpServletResponse();
    this.request.setAttribute(DispatcherServlet.OUTPUT_FLASH_MAP_ATTRIBUTE, new FlashMap());
    this.request.setAttribute(DispatcherServlet.FLASH_MAP_MANAGER_ATTRIBUTE, new SessionFlashMapManager());
  }
View Full Code Here

Examples of org.springframework.web.servlet.support.SessionFlashMapManager

    wac.addBeans(initViewResolvers(wac));
    wac.addBean(DispatcherServlet.LOCALE_RESOLVER_BEAN_NAME, this.localeResolver);
    wac.addBean(DispatcherServlet.THEME_RESOLVER_BEAN_NAME, new FixedThemeResolver());
    wac.addBean(DispatcherServlet.REQUEST_TO_VIEW_NAME_TRANSLATOR_BEAN_NAME, new DefaultRequestToViewNameTranslator());

    this.flashMapManager = new SessionFlashMapManager();
    wac.addBean(DispatcherServlet.FLASH_MAP_MANAGER_BEAN_NAME, this.flashMapManager);
  }
View Full Code Here

Examples of org.springframework.web.servlet.support.SessionFlashMapManager

      // ignore
    }
    catch (NoSuchBeanDefinitionException ex) {
      // ignore
    }
    return (flashMapManager != null ? flashMapManager : new SessionFlashMapManager());
  }
View Full Code Here

Examples of org.springframework.web.servlet.support.SessionFlashMapManager

  @Test
  public void flashAttribute() {
    this.builder.flashAttr("foo", "bar");
    MockHttpServletRequest request = this.builder.buildRequest(this.servletContext);

    FlashMap flashMap = new SessionFlashMapManager().retrieveAndUpdate(request, null);
    assertNotNull(flashMap);
    assertEquals("bar", flashMap.get("foo"));
  }
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.