use of ratpack.thymeleaf.internal.ThymeleafServletContextAdapter in project ratpack by ratpack.
the class Template method thymeleafTemplate.
public static Template thymeleafTemplate(Map<String, ?> model, String name, String contentType, IFragmentSpec fragmentSpec) {
HttpServletRequest request = new ThymeleafHttpServletRequestAdapter();
HttpServletResponse response = new ThymeleafHttpServletResponseAdapter();
ServletContext servletContext = new ThymeleafServletContextAdapter();
WebContext context = new WebContext(request, response, servletContext);
if (model != null) {
context.setVariables(model);
}
return new Template(name, context, contentType, fragmentSpec);
}
Aggregations