title: How do I add Freemarker support to a Spring MVC webapp? Dependency issue?
body: <p>I'm trying to create a Spring MVC application using Freemarker and Java configuration.</p>
  
  <p>I'm used to using JSPs, but thought I'd give Freemarker a spin in this project.</p>
  
  <p>I've added Freemarker as a dependancy and the jar is being downloaded by Maven:</p>
  
  <pre><code>        &lt;dependency&gt;
          &lt;groupId&gt;org.freemarker&lt;/groupId&gt;
          &lt;artifactId&gt;freemarker&lt;/artifactId&gt;
          &lt;version&gt;2.3.20&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>I'm trying to use 3.2.3.RELEASE version of Spring.</p>
  
  <p>My MVC configuration, assembled from reading similar question:</p>
  
  <pre><code>@ComponentScan(basePackages="yhj.*")
  @EnableWebMvc
  public class MvcConfiguration extends WebMvcConfigurerAdapter{
  
  
  @Bean
  public ViewResolver viewResolver() {
      FreeMarkerViewResolver resolver = new FreeMarkerViewResolver();
      resolver.setCache(true);
      resolver.setPrefix("");
      resolver.setSuffix(".ftl");
      return resolver;
  
  }
  
  @Bean
  public FreeMarkerConfigurer freemarkerConfig() {
      FreeMarkerConfigurer result = new FreeMarkerConfigurer();
      result.setTemplateLoaderPath("/WEB-INF/views/");
      return result;
  
  }
  }
  </code></pre>
  
  <p>When I try run this up I get a compilation error, my IDE is telling me the method 'setTemplateLoaderPath(String)' cannot be resolved.</p>
  
  <p>So... does look like the right way of going about configuring Spring MVC with Freemarker? What dependency do I need to add to my POM if that is the issue?</p>