Eclipse Maven项目 Spring4 MVC 配置 Freemarker视图添加 templateLoaderPath 时报错
2014-05-04 21:57
801 查看
在Eclipse Maven项目 Spring4 MVC 配置 Freemarker视图时报错
在spring-mvc.xml中添加如下块
在网上找到了一些热心网友的提示:
http://viralpatel.net/blogs/spring-mvc-freemarker-ftl-example/
在spring-mvc.xml中添加如下块
<!-- freemarker config --> <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer"> <property name="templateLoaderPath" value="/WEB-INF/freemarker/" /> </bean>之后,Eclipse显示:
Multiple annotations found at this line: - No setter found for property 'templateLoaderPath' in class 'org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer'
在网上找到了一些热心网友的提示:
http://viralpatel.net/blogs/spring-mvc-freemarker-ftl-example/
Adam McCormick 25 June, 2013, 9:41 You need to include spring-context-support.jar. FreeMarkerConfigurationFactory was moved. See: https://jira.springsource.org/browse/SPR-10233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel[/code]说是需要一个 spring-context-support.jar 的包
由于项目是Maven的,所以,在项目的pom.xml中添加 dependency<dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>4.0.4.RELEASE</version> </dependency>
【额外发现 : 】
两种Freemarker模板路径设置方法
基于注解的SpringMVC+freemarker环境搭建
本文出自 “菜鸟笨飞” 博客,请务必保留此出处http://srteert.blog.51cto.com/4009782/1406326
相关文章推荐
- eclipse 新建 maven 项目 添加 spring hibernate 的配置文件 详情
- maven构建项目二(添加配置文件)SpringMvc+Spring+Mybatis
- eclipse 中创建 整合springmvc+mybatis+maven 的java web项目步骤,以及maven仓库配置
- Spring + Spring MVC +Maven + FreeMarker 配置
- Maven常用配置(springMVC+Freemarker)
- Eclipse上创建一个Maven+Spring MVC的HelloWord项目2:发布项目
- 简单MVC项目搭建--Java1.7+Eclipse luna + Maven 3.2.5 +spring 4.1.4
- maven 项目 spring mvc + jdbc 配置文件
- eclipse maven+mybatis+spring+springmvc 项目启动报错:java.lang.ClassNotFoundException: org.aspectj.weaver.r
- springmvc+mongodb+maven 项目搭建配置
- Maven搭建SpringMVC+Mybatis+freemarker项目详解
- springmvc+mongodb+maven 项目搭建配置
- springmvc+mongodb+maven 项目搭建配置
- intellij idea 12 搭建maven web项目 freemarker + spring mvc(续)
- ***Spring MVC的多视图解析器配置及与Freemarker的集成
- eclipse中创建maven项目, maven无法加载org.springframework.web.context.ContextLoaderListener
- Eclipse上Maven+Spring MVC的HelloWord项目的tiles整合
- Eclipse执行import命令导入maven项目时报错:Add a version or custom suffix using "Name template" in "Advanced" settings
- maven+springMVC+hibernate项目搭建(三spring配置结束)
- 初识Spring-MVC之最小配置运行Hello world的maven项目