title: Spring boot Thymeleaf context parameter is not passed to template
body: <p>I'm using thymeleaf as a template engine but I cant get it to work properly. </p>
  
  <p>I'm using websockets to push html to the web browser so I try to process the template with the context into a string. This string is then send to the browser to show. </p>
  
  <p>My Controller class:</p>
  
  <pre><code>@Autowired
  private SimpMessagingTemplate simpMessagingTemplate;
  
  @Autowired
  private SpringTemplateEngine springTemplateEngine;
  
  private void send() {
      Map&lt;String, Object&gt; params = new HashMap&lt;&gt;();
      params.put("name", "Willem");
  
      final IContext cts = new Context(Locale.ITALY, params);
      String result = springTemplateEngine.process("hello", ctx);
  
      simpMessagingTemplate.convertAndSend(destination, result);
  }
  </code></pre>
  
  <p>My thymeleaf configuration:</p>
  
  <pre><code>@Configuration
  public class ThymeleafConfig extends WebMvcConfigurerAdapter {
  
  @Bean
  public ClassLoaderTemplateResolver templateResolver() {
      ClassLoaderTemplateResolver templateResolver = new ClassLoaderTemplateResolver();
  
      templateResolver.setPrefix("thymeleaf/");
      templateResolver.setCacheable(false);
      templateResolver.setSuffix(".html");
      templateResolver.setTemplateMode("HTML5");
      templateResolver.setCharacterEncoding("UTF-8");
  
      return templateResolver;
  }
  
  @Bean
  public SpringTemplateEngine templateEngine() {
      SpringTemplateEngine templateEngine = new SpringTemplateEngine();
  
      templateEngine.setTemplateResolver(templateResolver());
  
      return templateEngine;
  }
  
  @Bean
  public ViewResolver viewResolver() {
      ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
  
      viewResolver.setTemplateEngine( templateEngine());
      viewResolver.setCharacterEncoding("UTF-8");
  
      return viewResolver;
  }
  }
  </code></pre>
  
  <p>And my hello.html template:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;body&gt; 
      &lt;h2&gt;Hello ${name} - THYMELEAF&lt;/h2&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I print the string result from the send method, I get this output:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;body&gt; 
      &lt;h2&gt;Hello ${name} - THYMELEAF&lt;/h2&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Whatever I try, I can't get the parameters to be passed to the template.</p>