title: How to use thymeleaf without controller
body: <p>I want to use thymeleaf templates in my spring boot application. I've some html pages in the <code>src/resources/public</code> directory and I want them to be served wihout writing a controller because I want to write a front end application. I can access the <code>index.html</code> file at <code>http://localhost:8080/index.html</code> but it's not using the thymeleaf syntax. How can I do it?</p>
  
  <p>I've added the thymeleaf dependency, tried writing a <code>SpringResourceTemplateResolver</code> bean but still no luck. Here is what I've done so far:</p>
  
  <pre><code>@SpringBootApplication
  public class MyApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(MyApplication.class, args);
      }
  
      @Bean
      public SpringResourceTemplateResolver templateResolver(){
          SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver();
          templateResolver.setPrefix("classpath:/public/");
          templateResolver.setSuffix(".html");
          templateResolver.setTemplateMode(TemplateMode.HTML);
          templateResolver.setCacheable(true);
          return templateResolver;
      }
  }
  </code></pre>