title: Spring thymeleaf implementation
body: <p>Hi can someone refer me or teach me on how do I implement thymeleaf in spring framework? I have a dynamic web project but all the tutorials I have seen uses maven. I am trying to work this for almost a week.</p>
  
  <p>I have these beans:</p>
  
  <pre><code>&lt;bean id="templateResolver" class="org.thymeleaf.templateresolver.ServletContextTemplateResolver"&gt;
    &lt;property name="prefix" value="/WEB-INF/Views/" /&gt;
    &lt;property name="suffix" value=".html" /&gt;
    &lt;property name="templateMode" value="HTML5" /&gt;
    &lt;constructor-arg ref="servletContext"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="templateEngine"
        class="org.thymeleaf.spring4.SpringTemplateEngine"&gt;
    &lt;property name="templateResolver" ref="templateResolver" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: Could not initialize class org.thymeleaf.templateresolver.ServletContextTemplateResolver
  sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
  java.lang.reflect.Constructor.newInstance(Unknown Source)
  org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:170)
  org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117)
  org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:271)
  org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1274)
  org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1131)
  org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:541)
  org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501)
  org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
  org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
  org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
  org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
  org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760)
  org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
  org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
  org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:672)
  org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:638)
  org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:686)
  org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:554)
  org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:499)
  org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:172)
  javax.servlet.GenericServlet.init(GenericServlet.java:158)
  org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
  org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
  org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
  org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
  org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
  org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1468)
  org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
  java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
  java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>Thanks in advance.</p>