Is there a way to make Spring Thymeleaf process a string template? <p>I would like to write something like :</p> <pre><code> @Autowired private SpringTemplateEngine engine; .... // Thymeleaf Context WebContext thymeleafContext = new WebContext(request, response, request.getServletContext(), locale); // cached html of a thymeleaf template file String cachedHtml=.... // process the cached html String html=engine.process(cachedHtml, thymeleafContext); </code></pre> <p>By default, the [process] method can't do that. I can understand from the docs that I need a special Template Resolver :</p> <p><em>In order to execute templates, the process(String, IContext) method will be used: final String result = templateEngine.process("mytemplate", ctx); The "mytemplate" String argument is the template name, and it will relate to the <strong>physical/logical location</strong> of the template itself in a way configured at the template resolver/s.</em></p> <p>Does anyone know how to solve my problem ?</p> <p>The goal is to cache the Thymeleaf templates (files) in strings and then process theses strings rather than the files.</p>