Package org.springframework.web.servlet

Examples of org.springframework.web.servlet.ModelAndView


    expect(wac.getBean("resolver_name")).andReturn(viewResolver);
    expect(request.getAttribute(Globals.LOCALE_KEY)).andReturn(locale);
    expect(viewResolver.resolveViewName("view_name", locale)).andReturn(view);

    replayMocks();
    ViewAdapter adapter = handler.getActionForward(context, new ModelAndView("view_name", model));

    assert adapter instanceof SpringRenderingViewAdapter;
    SpringRenderingViewAdapter va = (SpringRenderingViewAdapter) adapter;
    assert va.getModel().equals(model);
    assert va.getView() == view;
View Full Code Here


    replayMocks();

    try
    {
      handler.getActionForward(context, new ModelAndView("view_name", model));
    }
    catch (ApplicationConfigurationException e)
    {
      assertEquals(e.getMessage(), "Bean referenced using the 'resolver' attribute of @SpringView "
          + "annotation is not instance of " + "org.springframework.web.servlet.ViewResolver");
View Full Code Here

    replayMocks();

    try
    {
      handler.getActionForward(context, new ModelAndView("view_name", model));
    }
    catch (ApplicationRuntimeException e)
    {
      assert e.getMessage().startsWith("Exception thrown during resolution of view name view_name using ViewResolver");
    }
View Full Code Here

    expect(servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE))
        .andReturn(wac);
    expect(wac.getBean("view_name")).andReturn(view);

    replayMocks();
    ViewAdapter adapter = handler.getActionForward(context, new ModelAndView("view_name", model));

    assert adapter instanceof SpringRenderingViewAdapter;
    SpringRenderingViewAdapter va = (SpringRenderingViewAdapter) adapter;
    assert va.getModel().equals(model);
    assert va.getView() == view;
View Full Code Here

    expect(context.getRequest()).andReturn(request);
    request.setAttribute(eq(DispatcherServlet.LOCALE_RESOLVER_ATTRIBUTE), isA(StrecksLocaleResolver.class));

    replayMocks();
    ViewAdapter adapter = handler.getActionForward(context, new ModelAndView(view, model));

    assert adapter instanceof SpringRenderingViewAdapter;
    SpringRenderingViewAdapter va = (SpringRenderingViewAdapter) adapter;
    assert va.getModel().equals(model);
    assert va.getView() == view;
View Full Code Here

    replayMocks();

    try
    {
      handler.getActionForward(context, new ModelAndView("view_name", model));
    }
    catch (ApplicationConfigurationException e)
    {
      assertEquals(e.getMessage(), "Bean referenced using the 'viewName' property " +
          "of the returned ModelAndView of the method containing @SpringView " +
View Full Code Here

public class ActionWithSpringResolverNavigation
{
  @SpringView(resolver = "resolver_name")
  public ModelAndView getResult()
  {
    return new ModelAndView("my_view_name");
  }
View Full Code Here

public class ActionWithSpringViewNavigation
{
  @SpringView()
  public ModelAndView getResult()
  {
    return new ModelAndView("my_view_name");
  }
View Full Code Here

        cell = getCell(sheet, 1, 0);
        cell.setCellValue(new Date());
        cell.setCellStyle(dateStyle);
      }
    };
    return new ModelAndView(view);
  }
View Full Code Here

  @SpringView()
  public ModelAndView getResult()
  {
    JstlView view = new JstlView();
    view.setUrl("/message.jsp");
    return new ModelAndView(view);
  }
View Full Code Here

TOP

Related Classes of org.springframework.web.servlet.ModelAndView

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.