title: Maven + Spring MVC + GWT + Thymeleaf - error resolving template "error"
body: <p>For a few days I've been having a problem with launching a spring application. It's supposed to be using Spring Boot, Integration, Security, Web MVC, and have GWT on top of that. Springboot launches and runs okay, but once I reqest the page, I get this error:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>2016-10-16 16:00:46.531 DEBUG 10396 --- [nio-8080-exec-2] o.s.b.w.f.OrderedRequestContextFilter    : Bound request context to thread: org.apache.catalina.connector.RequestFacade@3ca12dbf
  2016-10-16 16:00:46.532 DEBUG 10396 --- [nio-8080-exec-2] o.s.b.w.f.OrderedRequestContextFilter    : Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@3ca12dbf
  2016-10-16 16:00:46.534 ERROR 10396 --- [nio-8080-exec-2] org.thymeleaf.TemplateEngine             : [THYMELEAF][http-nio-8080-exec-2] Exception processing template "error": Error resolving template "error", template might not exist or might not be accessible by any of the configured Template Resolvers
  2016-10-16 16:00:46.535 ERROR 10396 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet dispatcherServlet threw exception
  
  org.thymeleaf.exceptions.TemplateInputException: Error resolving template "error", template might not exist or might not be accessible by any of the configured Template Resolvers
   at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:246) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
   at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1104) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
   at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1060) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
   at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1011) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
   at org.thymeleaf.spring4.view.ThymeleafView.renderFragment(ThymeleafView.java:335) ~[thymeleaf-spring4-2.1.5.RELEASE.jar:2.1.5.RELEASE]
   at org.thymeleaf.spring4.view.ThymeleafView.render(ThymeleafView.java:190) ~[thymeleaf-spring4-2.1.5.RELEASE.jar:2.1.5.RELEASE]
   at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1257) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
   at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1037) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:980) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) ~[gwt-user.jar:na]
   at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[gwt-user.jar:na]
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) ~[tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ~[tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:721) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:468) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:391) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:433) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:299) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:176) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_92]
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_92]
   at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_92]
  
  2016-10-16 16:00:46.536 ERROR 10396 --- [nio-8080-exec-2] o.a.c.c.C.[Tomcat].[localhost]           : Exception Processing ErrorPage[errorCode=0, location=/error]
  
  org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: Error resolving template "error", template might not exist or might not be accessible by any of the configured Template Resolvers
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) ~[gwt-user.jar:na]
   at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[gwt-user.jar:na]
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) ~[tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) ~[tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:721) ~[tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:468) ~[tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:391) ~[tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318) ~[tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:433) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:299) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:176) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_92]
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_92]
   at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.15.jar:8.0.15]
   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_92]
  Caused by: org.thymeleaf.exceptions.TemplateInputException: Error resolving template "error", template might not exist or might not be accessible by any of the configured Template Resolvers
   at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:246) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
   at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1104) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
   at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1060) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
   at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1011) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
   at org.thymeleaf.spring4.view.ThymeleafView.renderFragment(ThymeleafView.java:335) ~[thymeleaf-spring4-2.1.5.RELEASE.jar:2.1.5.RELEASE]
   at org.thymeleaf.spring4.view.ThymeleafView.render(ThymeleafView.java:190) ~[thymeleaf-spring4-2.1.5.RELEASE.jar:2.1.5.RELEASE]
   at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1257) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
   at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1037) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:980) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
   ... 25 common frames omitted</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am very new to both spring and thymeleaf. I am using Intellij Idea 16, project was based on spring boot and it has maven :</p>
  
  <p>pom.xml: </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
   &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
   &lt;groupId&gt;com.lingoking&lt;/groupId&gt;
   &lt;artifactId&gt;jagsproject&lt;/artifactId&gt;
   &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
   &lt;packaging&gt;war&lt;/packaging&gt;
   &lt;name&gt;SpringProject&lt;/name&gt;
   &lt;description&gt;Demo project for compaany&lt;/description&gt;
  
   &lt;parent&gt;
    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
    &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
    &lt;version&gt;1.4.1.RELEASE&lt;/version&gt;
    &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
   &lt;/parent&gt;
  
   &lt;distributionManagement&gt;
    &lt;repository&gt;
     &lt;uniqueVersion&gt;false&lt;/uniqueVersion&gt;
     &lt;id&gt;lingoking&lt;/id&gt;
     &lt;name&gt;Lingoking Repository&lt;/name&gt;
     &lt;url&gt;file:///out/&lt;/url&gt;
     &lt;layout&gt;default&lt;/layout&gt;
    &lt;/repository&gt;
   &lt;/distributionManagement&gt;
  
   &lt;properties&gt;
    &lt;gwtVersion&gt;2.6.0&lt;/gwtVersion&gt;
    &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
    &lt;java.version&gt;1.8&lt;/java.version&gt;
  
    &lt;tomcat.version&gt;8.0.15&lt;/tomcat.version&gt;
  
  
   &lt;/properties&gt;
  
   &lt;dependencies&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;com.google.gwt&lt;/groupId&gt;
     &lt;artifactId&gt;gwt-servlet&lt;/artifactId&gt;
     &lt;version&gt;${gwtVersion}&lt;/version&gt;
     &lt;scope&gt;runtime&lt;/scope&gt;
    &lt;/dependency&gt;
  
    &lt;dependency&gt;
     &lt;groupId&gt;com.google.gwt&lt;/groupId&gt;
     &lt;artifactId&gt;gwt-user&lt;/artifactId&gt;
     &lt;version&gt;${gwtVersion}&lt;/version&gt;
     &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;javax.persistence&lt;/groupId&gt;
     &lt;artifactId&gt;persistence-api&lt;/artifactId&gt;
     &lt;version&gt;1.0&lt;/version&gt;
     &lt;optional&gt;true&lt;/optional&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;javax.el&lt;/groupId&gt;
     &lt;artifactId&gt;javax.el-api&lt;/artifactId&gt;
     &lt;version&gt;2.2.4&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;org.glassfish.web&lt;/groupId&gt;
     &lt;artifactId&gt;javax.el&lt;/artifactId&gt;
     &lt;version&gt;2.2.4&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
     &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
     &lt;version&gt;4.3.1.Final&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;org.thymeleaf.extras&lt;/groupId&gt;
     &lt;artifactId&gt;thymeleaf-extras-springsecurity4&lt;/artifactId&gt;
     &lt;version&gt;2.1.2.RELEASE&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
     &lt;artifactId&gt;spring-boot-starter-jdbc&lt;/artifactId&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;org.springframework.session&lt;/groupId&gt;
     &lt;artifactId&gt;spring-session&lt;/artifactId&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
     &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
     &lt;exclusions&gt;
      &lt;exclusion&gt;
       &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
       &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      &lt;/exclusion&gt;
     &lt;/exclusions&gt;
    &lt;/dependency&gt;
  
    &lt;dependency&gt;
     &lt;groupId&gt;mysql&lt;/groupId&gt;
     &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
     &lt;scope&gt;runtime&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
     &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
     &lt;scope&gt;test&lt;/scope&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;dependency&gt;
     &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
     &lt;artifactId&gt;spring-boot-starter-web-services&lt;/artifactId&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
     &lt;artifactId&gt;spring-boot-starter-websocket&lt;/artifactId&gt;
    &lt;/dependency&gt;
  
  
    &lt;dependency&gt;
     &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
     &lt;artifactId&gt;spring-boot-starter-integration&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.security&lt;/groupId&gt;
     &lt;artifactId&gt;spring-security-test&lt;/artifactId&gt;
     &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
     &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
     &lt;artifactId&gt;spring-boot-starter-validation&lt;/artifactId&gt;
     &lt;exclusions&gt;
      &lt;exclusion&gt;
       &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
       &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      &lt;/exclusion&gt;
     &lt;/exclusions&gt;
    &lt;/dependency&gt;
   &lt;/dependencies&gt;
  
   &lt;dependencyManagement&gt;
    &lt;dependencies&gt;
     &lt;dependency&gt;
      &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
      &lt;artifactId&gt;vaadin-bom&lt;/artifactId&gt;
      &lt;version&gt;7.7.3&lt;/version&gt;
      &lt;type&gt;pom&lt;/type&gt;
      &lt;scope&gt;import&lt;/scope&gt;
     &lt;/dependency&gt;
    &lt;/dependencies&gt;
   &lt;/dependencyManagement&gt;
  
   &lt;build&gt;
    &lt;outputDirectory&gt;WEB-INF/classes&lt;/outputDirectory&gt;
    &lt;pluginManagement&gt;
    &lt;plugins&gt;
     &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.1.1&lt;/version&gt;
      &lt;executions&gt;
       &lt;execution&gt;
        &lt;phase&gt;compile&lt;/phase&gt;
        &lt;goals&gt;
         &lt;goal&gt;exploded&lt;/goal&gt;
        &lt;/goals&gt;
       &lt;/execution&gt;
      &lt;/executions&gt;
      &lt;configuration&gt;
       &lt;webappDirectory&gt;${webappDirectory}&lt;/webappDirectory&gt;
      &lt;/configuration&gt;
     &lt;/plugin&gt;
     &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.3.2&lt;/version&gt;
      &lt;configuration&gt;
       &lt;source&gt;1.5&lt;/source&gt;
       &lt;target&gt;1.5&lt;/target&gt;
      &lt;/configuration&gt;
     &lt;/plugin&gt;
     &lt;plugin&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
     &lt;/plugin&gt;
     &lt;plugin&gt;
     &lt;groupId&gt;com.google.appengine&lt;/groupId&gt;
     &lt;artifactId&gt;appengine-maven-plugin&lt;/artifactId&gt;
     &lt;version&gt;1.8.3&lt;/version&gt;
     &lt;/plugin&gt;
    &lt;/plugins&gt;
    &lt;/pluginManagement&gt;
   &lt;/build&gt;
  
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;central&lt;/id&gt;
          &lt;url&gt;http://central.maven.org/maven2/&lt;/url&gt;
      &lt;/repository&gt;
   &lt;repository&gt;
    &lt;id&gt;spring-releases&lt;/id&gt;
    &lt;name&gt;Spring Releases&lt;/name&gt;
    &lt;url&gt;https://repo.spring.io/libs-release&lt;/url&gt;
   &lt;/repository&gt;
   &lt;repository&gt;
    &lt;id&gt;maven2-repository.dev.java.net&lt;/id&gt;
    &lt;name&gt;Java.net Repository for Maven&lt;/name&gt;
    &lt;url&gt;http://download.java.net/maven/2/&lt;/url&gt;
   &lt;/repository&gt;
   &lt;repository&gt;
    &lt;id&gt;com.springsource.repository.bundles.release&lt;/id&gt;
    &lt;name&gt;EBR Spring Release Repository&lt;/name&gt;
    &lt;url&gt;http://repository.springsource.com/maven/bundles/release&lt;/url&gt;
   &lt;/repository&gt;
   &lt;repository&gt;
    &lt;id&gt;com.springsource.repository.bundles.external&lt;/id&gt;
    &lt;name&gt;EBR External Release Repository&lt;/name&gt;
    &lt;url&gt;http://repository.springsource.com/maven/bundles/external&lt;/url&gt;
   &lt;/repository&gt;
  &lt;/repositories&gt;
   &lt;pluginRepositories&gt;
    &lt;pluginRepository&gt;
     &lt;id&gt;spring-releases&lt;/id&gt;
     &lt;name&gt;Spring Releases&lt;/name&gt;
     &lt;url&gt;https://repo.spring.io/libs-release&lt;/url&gt;
    &lt;/pluginRepository&gt;
   &lt;/pluginRepositories&gt;
  &lt;/project&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>MVC Configuration:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>package com.lingoking.server.util;
  
  import org.springframework.context.annotation.Configuration;
  import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
  import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
  
  /**
   * Created by Woodbin on 14.10.2016.
   */
  @Configuration
  public class GenericMvcConfiguration extends WebMvcConfigurerAdapter {
  
      @Override
      public void addViewControllers(ViewControllerRegistry vrc) {
          vrc.addViewController("/templates/genericCategoryBrowserPage.html").setViewName("Category browser");
          vrc.addViewController("/templates/genericHomePage.html").setViewName("Home Page");
          //vrc.addViewController("/").setViewName("Home Page");
          vrc.addViewController("/templates/genericLoginPage.html").setViewName("Login Page");
  
  
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thymeleaf configuration class:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>package com.lingoking.server.util;
  
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.web.servlet.ViewResolver;
  import org.springframework.web.servlet.view.ContentNegotiatingViewResolver;
  import org.thymeleaf.dialect.IDialect;
  import org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect;
  import org.thymeleaf.spring4.SpringTemplateEngine;
  import org.thymeleaf.spring4.view.ThymeleafViewResolver;
  import org.thymeleaf.templateresolver.ServletContextTemplateResolver;
  
  import java.util.ArrayList;
  import java.util.HashSet;
  import java.util.List;
  import java.util.Set;
  
  /**
   * Created by Woodbin on 16.10.2016.
   */
  @Configuration
  public class ThymeConfig {
  
      @Bean
      public ServletContextTemplateResolver templateResolver() {
          ServletContextTemplateResolver resolver = new ServletContextTemplateResolver();
          resolver.setPrefix("/templates");
          //resolver.setSuffix(".html");
          resolver.setTemplateMode("HTML5");
          resolver.setCharacterEncoding("UTF-8");
          resolver.setCacheable(false);
          resolver.setOrder(1);
          return resolver;
  
      }
  
      @Bean
      public SpringTemplateEngine templateEngine() {
  
                  /* New SpringTemplateEngine object */
          SpringTemplateEngine engine = new SpringTemplateEngine();
  
                  /* Add the configured ServletContextTemplateResolver to the SpringTemplateEngine */
          engine.setTemplateResolver(templateResolver());
  
                  /* Create a set for additional dialects */
          Set&lt;IDialect&gt; dialects = new HashSet&lt;IDialect&gt;();
  
                  /* Add Thymeleaf substitute for SpringSecurity taglib */
          dialects.add(new SpringSecurityDialect());
  
                  /* Add the additional dialects to the TemplateEngine */
          engine.setAdditionalDialects(dialects);
  
          return engine;
      }
  
      @Bean
      public ViewResolver ContentNegotiatingViewResolver() {
          ContentNegotiatingViewResolver resolver = new ContentNegotiatingViewResolver();
  
          //
          ThymeleafViewResolver tvr = new ThymeleafViewResolver();
          tvr.setTemplateEngine(templateEngine());
          tvr.setOrder(1);
  
          //
          List&lt;ViewResolver&gt; viewResolvers = new ArrayList&lt;ViewResolver&gt;();
          viewResolvers.add(tvr);
  
          resolver.setViewResolvers(viewResolvers);
          return resolver;
      }
  
  
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Web Security configuration class:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>package com.lingoking.server.util;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.context.annotation.ComponentScan;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
  import org.springframework.security.config.annotation.web.builders.HttpSecurity;
  import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
  import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
  import org.springframework.validation.Validator;
  
  import javax.servlet.annotation.MultipartConfig;
  
  /**
   * Created by Woodbin on 14.10.2016.
   */
  @Configuration
  @EnableWebSecurity
  @MultipartConfig
  @ComponentScan
  public class WebSecurityConfigurator extends WebSecurityConfigurerAdapter {
  
      private String param;
  
      @Override
      protected void configure(HttpSecurity httpSecurity) throws Exception {
          httpSecurity.authorizeRequests()
                  .antMatchers("/", "/templates/genericHomePage.html").permitAll()
                  .anyRequest().authenticated()
                  .and()
                  .formLogin()
                  .loginPage("/templates/genericLoginPage.hmtl").failureUrl("/templates/genericErrorPage.html")
                  .permitAll()
                  .and()
                  .logout()
                  .permitAll();
  
      }
  
      @Autowired
      public Validator validator;
  
      public Validator getValidator() {
          return validator;
      }
      @Autowired
      public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
          auth
                  .inMemoryAuthentication()
                  .withUser("user").password("password").roles("USER");
      }
  
  
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Application.properties:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>spring.datasource.url=jdbc:mysql://localhost spring.datasource.username=woodbin spring.datasource.password=34369529 spring.datasource.driver-class-name=com.mysql.jdbc.Driver
  spring.session.store-type=none
  security.basic.enabled=false
  security.user.name=woodbin
  security.user.password=552266
  spring.application.admin.enabled=false
  spring.thymeleaf.check-template-location=true
  spring.thymeleaf.enabled=true
  spring.thymeleaf.mode=HTML5</code></pre>
  </div>
  </div>
  </p>
  
  <p>Beans.xml:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"&gt;
  
  
      &lt;bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"/&gt;
  
  &lt;/beans&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Web.xml from /war/WEB-INF/:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
                               http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
           version="3.1"&gt;
  
      &lt;display-name&gt;Just another Generic System&lt;/display-name&gt;
  
      &lt;!-- Spring MVC --&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;mvc&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;mvc&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;contextClass&lt;/param-name&gt;
          &lt;param-value&gt;
              org.springframework.web.context.support.AnnotationConfigWebApplicationContext
          &lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;org.baeldung.spring.web.config&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;
              org.springframework.web.context.ContextLoaderListener
          &lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;!-- Spring Security --&gt;
      &lt;filter&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
      &lt;/filter&gt;
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
  &lt;/web-app&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I would appreciate any help as I spend a few days googling, trying various things and till can't get it to work. I hope I provided all needed info.</p>