springMVC与freemarker整合

主要遇到以下两个问题:

freemarker.template.TemplateHashModelEx

Exception in thread "main" java.lang.NoClassDefFoundError: freemarker/template/TemplateHashModelEx
    .
    .
    .
Caused by: java.lang.ClassNotFoundException: freemarker.template.TemplateHashModelEx
    .
    .
    .

在pom.xml中加入,

<dependency>
    <groupId>org.freemarkergroupId>
    <artifactId>freemarker-gaeartifactId>
    <version>2.3.18version>
dependency>

Caused by: java.lang.NoClassDefFoundError: org/springframework/ui/freemarker/FreeMarkerConfiguration

1. Build path is incomplete. Cannot find class file for org/springframework/ui/freemarker/
 FreeMarkerConfigurationFactory

2.No setter found for property 'templateLoaderPath' in class 
 'org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer' [config set: Warehouse/web-context]

在pom.xml中加入

<dependency>
    <groupId>org.springframeworkgroupId>
    <artifactId>spring-context-supportartifactId>
    <version>3.2.4.RELEASEversion>
dependency>

你可能感兴趣的:(springMVC与freemarker整合)