title: Thymeleaf : org.thymeleaf.exceptions.TemplateInputException
body: <p>i am trying to use thymeleaf <code>3.0.7.RELEASE</code>with spring mvc java based configuration. </p>
  
  <pre><code>@Configuration
  @EnableWebMvc
  @ComponentScan(basePackages = "com.sagar")
  public class MvcConfig extends WebMvcConfigurerAdapter implements ApplicationContextAware{
  
      @Autowired
      RoleToUserProfileConverter roleToUserProfileConverter;
  
      private ApplicationContext applicationContext;
  
      public void setApplicationContext(ApplicationContext applicationContext) {
          this.applicationContext = applicationContext;
      }
  
      @Bean
      public ViewResolver viewResolver() {
          ThymeleafViewResolver resolver = new ThymeleafViewResolver();
          resolver.setTemplateEngine(templateEngine());
          resolver.setCharacterEncoding("UTF-8");
          return resolver;
      }
  
      @Bean
      public TemplateEngine templateEngine() {
          SpringTemplateEngine engine = new SpringTemplateEngine();
          engine.setEnableSpringELCompiler(true);
          engine.setTemplateResolver(templateResolver());
          return engine;
      }
  
      private ITemplateResolver templateResolver() {
          SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver();
          resolver.setApplicationContext(applicationContext);
          resolver.setPrefix("/WEB-INF/templates/");
          resolver.setTemplateMode(TemplateMode.HTML);
          return resolver;
      }
  
      public void addResourceHandlers(ResourceHandlerRegistry registry){
          registry.addResourceHandler("/static/**").addResourceLocations("/static/");
  
      }
  }
  </code></pre>
  
  <p>methods inside springsecurity configuration class.</p>
  
  <pre><code> @Autowired
      public void configureGlobalSecurity(AuthenticationManagerBuilder auth)
       throws Exception{
          auth.userDetailsService(userDetailsService);
          auth.authenticationProvider(authenticationProvider());
      }
  
      protected void configure(HttpSecurity http) throws Exception {
          http.authorizeRequests()
                  .antMatchers("/").permitAll()
                  .antMatchers( "/admin/list")
                  .access("hasRole('USER') or hasRole('ADMIN') or hasRole('DBA')")
                  .antMatchers("/newuser/**", "/delete-user-*").access("hasRole
                  ('ADMIN')").antMatchers("/edit-user-*")
                  .access("hasRole('ADMIN') or hasRole('DBA')").and().formLogin()
                  .loginPage("/login")
                  .loginProcessingUrl("/login").usernameParameter("ssoId").
                  passwordParameter("password").and()
                  .rememberMe().rememberMeParameter("remember-me").
                  tokenRepository(tokenRepository)
                  .tokenValiditySeconds(86400).and().csrf().and().exceptionHandling()
                  .accessDeniedPage("/Access_Denied");
      }
  </code></pre>
  
  <p>and my <strong>home.html</strong> file</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en" xmlns:th="http://www.thymeleaf.org"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Title&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  this is home page using thymeleaf
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>my pom.xml dependencies includes</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;org.thymeleaf&lt;/groupId&gt;
    &lt;artifactId&gt;thymeleaf-spring4&lt;/artifactId&gt;
    &lt;version&gt;3.0.7.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;!-- https://mvnrepository.com/artifact/org.thymeleaf/thymeleaf --&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.thymeleaf&lt;/groupId&gt;
    &lt;artifactId&gt;thymeleaf&lt;/artifactId&gt;
    &lt;version&gt;3.0.7.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>the spring security version is <code>4.2.3.RELEASE</code> and spring version is <code>4.3.9.RELEASE</code></p>
  
  <p>the errors i am getting are:- </p>
  
  <pre><code>Message Request processing failed; nested exception is 
  org.thymeleaf.exceptions.TemplateInputException: 
  An error happened during template parsing 
  (template: "ServletContext resource [/WEB-INF/templates/home]")
  
  
  Root Cause
  
  java.io.FileNotFoundException: Could not open ServletContext 
  resource [/WEB-INF/templates/home]
  
  Root Cause
  
  org.thymeleaf.exceptions.TemplateInputException: 
  An error happened during template parsing
   (template: "ServletContext resource [/WEB-INF/templates/home]")
  </code></pre>