Cannot find Velocity template for URL [layout.vm]
来源:互联网 发布:人工智能的好处英文 编辑:程序博客网 时间:2024/05/22 01:26
springmvc整合velocity的时候出现了以下错误Cannot find Velocity template for URL [layout.vm]: Did you specify the correct resource loader path?; nested exception is org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'layout.vm'读源码发现问题,我的配置是bean id="ViewResolver" class="org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver"这个bean会使用layout.vm布局,正确配置如下。bean id="ViewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver"
<!-- 配置velocity引擎 --><bean id="velocityConfigurer" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer"> <property name="resourceLoaderPath" value="/WEB-INF/page/" /><!-- 模板存放的路径 --> <property name="configLocation" value="classpath:velocity.properties" /></bean><!-- 配置视图的显示 --><bean id="ViewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver"> <!--<property name="prefix" value="/WEB-INF/page/" /><!– 视图文件的前缀,即存放的路径 –>--> <property name="suffix" value=".vm" /><!-- 视图文件的后缀名 --> <!--<property name="toolboxConfigLocation" value="/WEB-INF/tools.xml" /><!–toolbox配置文件路径–>--> <!--<property name="dateToolAttribute" value="date" /><!–日期函数名称–>--> <!--<property name="numberToolAttribute" value="number" /><!–数字函数名称–>--> <property name="contentType" value="text/html;charset=UTF-8" /> <!--<property name="exposeSpringMacroHelpers" value="true" /><!–是否使用spring对宏定义的支持–>--> <!--<property name="exposeRequestAttributes" value="true" /><!–是否开放request属性–>--> <!--<property name="requestContextAttribute" value="rc"/><!–request属性引用名称–>--></bean>
1 0
- Cannot find Velocity template for URL [layout.vm]
- Velocity 模板出现NestedIOException: Cannot find Velocity template for URL [layout.vm]
- Cannot find Velocity template for URL : Did you specify the correct resource loader path?
- 使用velocity时,报cannot find resrouce/找不到vm文件
- cannot find the word template:WordToRqm.dot
- Cannot find executable for CFBundle
- Cannot find executable for CFBundle
- Cannot find executable for CFBundle
- cannot find the word template:WordToRqm.dot的解决方法
- cannot find the word template:WordToRqm.dot的解决方法
- cannot find the word template:WordToRqm.dot的解决方法
- Word2010--Cannot find the Word template:WordToRqm.dot的解决方法
- cannot find the word template:WordToRqm.dot的解决方法
- Word 提示对话框 Cannot find the Word template:WordToRqm.dot
- ERROR: Cannot find dialog template with IDD 0x7803.
- Velocity语法(VM)
- Velocity语法(VM)
- velocity解析vm配置文件
- Akka入门
- Spring Security学习
- spring redis session共享
- K近邻算法
- 决策树
- Cannot find Velocity template for URL [layout.vm]
- maven-compiler-plugin插件
- Spring MVC @ResponseBody返回Json
- 48. Rotate Image
- Linux(Ubuntu)下第一个C程序(0)
- 位运算基础知识
- Java 初始化与清理
- Eclipse快捷键
- mybatis批量处理