freemarker报错之三
1、错误描写叙述
Expression students is undefined on line 30, column 24 in student.ftl.
The problematic instruction:
----------
==> list students as student [on line 30, column 17 in student.ftl]
---------- Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression students is undefined on line 30, column 24 in student.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:100)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.Environment.process(Environment.java:199)
at freemarker.template.Template.process(Template.java:259)
at com.you.freemarker.FreemarkerTemplate.printFtl(FreemarkerTemplate.java:77)
at com.you.test.freemarker.FreemarkerTest.student(FreemarkerTest.java:127)
at com.you.test.freemarker.FreemarkerTest.testStudent(FreemarkerTest.java:113)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
五月 27, 2014 10:45:07 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error
严重: Template processing error: "Expression students is undefined on line 30, column 24 in student.ftl." Expression students is undefined on line 30, column 24 in student.ftl.
The problematic instruction:
----------
==> list students as student [on line 30, column 17 in student.ftl]
---------- Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression students is undefined on line 30, column 24 in student.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:100)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.Environment.process(Environment.java:199)
at freemarker.template.Template.process(Template.java:259)
at com.you.freemarker.FreemarkerTemplate.printFile(FreemarkerTemplate.java:109)
at com.you.test.freemarker.FreemarkerTest.studentFile(FreemarkerTest.java:141)
at com.you.test.freemarker.FreemarkerTest.testStudent(FreemarkerTest.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Expression students is undefined on line 30, column 24 in student.ftl.
The problematic instruction:
----------
==> list students as student [on line 30, column 17 in student.ftl]
---------- Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression students is undefined on line 30, column 24 in student.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:100)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.Environment.process(Environment.java:199)
at freemarker.template.Template.process(Template.java:259)
at com.you.freemarker.FreemarkerTemplate.printFile(FreemarkerTemplate.java:109)
at com.you.test.freemarker.FreemarkerTest.studentFile(FreemarkerTest.java:141)
at com.you.test.freemarker.FreemarkerTest.testStudent(FreemarkerTest.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
2、错误原因
/**
* 測试freemarker中的list
* @Title:testList
* @Description:
* @param:
* @return: void
* @throws
*/
@Test
public void testList()
{
List<Student> students = Arrays.asList(new Student("张三丰","男",26,new Date(1988-12-12),"湖北省武汉市武昌洪山区",78451214),
new Student("李雪","女",20,new Date(1991-12-18),"湖北省武汉市武昌",85451214),
new Student("刘刘","男",22,new Date(1989-10-18),"湖南省长沙市",96551214),
new Student("吴明","女",21,new Date(1990-12-18),"广东省深圳市",56132012));
root.put("students", students);
ft.printFtl("stu.ftl",root);
}
3、解决的方法
freemarker报错之三的更多相关文章
- freemarker报错之四
1.错误描述 五月 28, 2014 9:56:48 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template proce ...
- freemarker报错之七
1.错误描述 五月 30, 2014 11:33:57 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template proc ...
- 关于SpringMVC整合freemarker报错问题
错误信息: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'FreeMa ...
- ALERT日志中常见监听相关报错之三:ORA-609 TNS-12537 and TNS-12547 or TNS-12170 TNS-12535错误的排查
1.11G中ALERT日志中有报错ORA-609 TNS-12537 and TNS-12547 or TNS-12170 12170, 'TNS-12535等问题的解决方法: Troublesho ...
- freemarker报错之八
1.错误描写叙述 freemarker.core.ParseException: Encountered "string" at line 21, column 21 in typ ...
- freemarker报错之二
1.错误描述 五月 27, 2014 12:07:05 上午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template proc ...
- freemarker报错之一
freemarker 1.错误描述 java.io.FileNotFoundException: Template user.ftl not found. at freemarker.template ...
- freemarker报错之六
1.错误描述 五月 28, 2014 10:32:40 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template proc ...
- freemarker报错之五
1.错误描述 freemarker.core.ParseException: Token manager error: freemarker.core.TokenMgrError: Lexical e ...
随机推荐
- NYOJ128 前缀式计算 【栈】
前缀式计算 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描写叙述 先说明一下什么是中缀式: 如2+(3+4)*5这样的我们最常见的式子就是中缀式. 而把中缀式按运算顺序加上 ...
- Spark 初级算子
#常用Transformation(即转换,延迟加载) #通过并行化scala集合创建RDD val rdd1 = sc.parallelize(Array(1,2,3,4,5,6,7,8)) #查看 ...
- 常用的50条linux 命令
从今天起,咱开始正式学习python了,于是遍整理了50条linux的常用命令. 1 线上查询帮助命令 :man 遇到什么不会的命令可以 man +你想要查询的命令 (需要有网),因为是英文的所以 ...
- tomcat配置数据源
1.修改conf下的context.xml,在<context>标签中添加: <Resource name="jdbc/soa" auth="Conta ...
- trailingZeroes
Given an integer n, return the number of trailing zeroes in n!. 给一个数字n,返回它n!数字后面有多少个0. public class ...
- IOS 请求服务器的方式
IOS 中请求服务器的方式主要有Get 和Post . Get :[1]向服务器发索取数据的一种请求; [2]获取信息,而不是修改信息,类似数据库查询功能一样,数据不会被修改;请求的参数会跟在url后 ...
- cocos2dx-触摸事件
//创建一个精灵 Sprite *spriteTest = Sprite::create("1.png"); spriteTest->setPosition(Point(,) ...
- cell的各种使用和赋值 总结
cell可以分为:自定义cell,系统的cell ,cell的自适应,.xib的cell //第一种cell:系统cell 在 UIViewController下创建UITableView //1.0 ...
- (一)CSS3动画应用 - CSS3 实现 侧边栏展开收起
@keyframes 规则用于创建动画. @keyframes 中规定某项 CSS 样式,就能创建由当前样式逐渐改为新样式的动画效果 @keyframes 中创建动画时,请把它捆绑到某个选择器,否则不 ...
- Oracle11g R2学习系列 之四Maven+Struts+Spring实验
今天试一下Java调用Oracle来看一下.会不会也如昨天实验的一样坑呢?由于我对于Java也接触的不多,所以不打算直接使用该收提供的实验文档,而是自己利用Maven+Struts+Spring来自己 ...