Package org.thymeleaf.spring3.view

Examples of org.thymeleaf.spring3.view.ThymeleafView


    context.register(ThymeleafAutoConfiguration.class,
        PropertyPlaceholderAutoConfiguration.class);
    MockServletContext servletContext = new MockServletContext();
    context.setServletContext(servletContext);
    context.refresh();
    ThymeleafView view = (ThymeleafView) context.getBean(ThymeleafViewResolver.class)
        .resolveViewName("view", Locale.UK);
    MockHttpServletResponse response = new MockHttpServletResponse();
    MockHttpServletRequest request = new MockHttpServletRequest();
    request.setAttribute(RequestContext.WEB_APPLICATION_CONTEXT_ATTRIBUTE, context);
    view.render(Collections.singletonMap("foo", "bar"), request, response);
    String result = response.getContentAsString();
    assertTrue("Wrong result: " + result, result.contains("<title>Content</title>"));
    assertTrue("Wrong result: " + result, result.contains("<span>bar</span>"));
    context.close();
  }
View Full Code Here

TOP

Related Classes of org.thymeleaf.spring3.view.ThymeleafView

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.