title: Spring Boot - Thymeleaf template
body: <p>I am using Spring Boot 1.2.7 and Thymeleaf.</p>
  
  <p>All the html pages are inside the <code>src/main/resource/templates</code> folder and everything works fine when I say <code>return "&lt;viewName&gt;"</code> inside the controller.</p>
  
  <p>Now, I would like to use different folder structure for AngularJS.</p>
  
  <p>Would like to move the pages to some other folder, say <code>webapps/pages</code>.</p>
  
  <p>Tried configuring the resolver as below,</p>
  
  <pre class="lang-java prettyprint-override"><code>@Configuration
  public class MvcConfig extends WebMvcConfigurerAdapter {
      @Bean
      public ServletContextTemplateResolver getViewResolver() {
          ServletContextTemplateResolver resolver = new ServletContextTemplateResolver();
          resolver.setPrefix("webapps/pages/");
          resolver.setSuffix(".html");
          resolver.setTemplateMode("LEGACYHTML5");
          return resolver;
      }
  
      @Override
      public void configureDefaultServletHandling(
              DefaultServletHandlerConfigurer configurer) {
          configurer.enable();
      }
  }
  </code></pre>
  
  <p>Still not working... Am I missing any other config or should I not use Thymeleaf in this case?</p>
  
  <p>pom.xml for your reference,</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;/artifactId&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>