WebContext ctx = new WebContext(request, response, getServletContext(), request.getLocale());
templateEngine.process(templateName, ctx, response.getWriter());
}
private static void initializeTemplateEngine() {
ServletContextTemplateResolver templateResolver = new ServletContextTemplateResolver();
templateResolver.setTemplateMode("HTML5");
templateResolver.setPrefix("/WEB-INF/templates/");
templateResolver.setSuffix(".html");
templateResolver.setCacheTTLMs(3600000L);
templateResolver.setCacheable(false);
templateEngine = new TemplateEngine();
templateEngine.setTemplateResolver(templateResolver);
templateEngine.addDialect(new DataTablesDialect());