1、错误描述

六月 25, 2014 11:32:49 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error
严重: Template processing error: "Macro select has no such argument: name"

Macro select has no such argument: name
The problematic instruction:
----------
==> macro select [on line 1, column 1 in inc/select.ftl]
 in user-directive items.select [on line 10, column 6 in address.ftl]
----------

Java backtrace for programmers:
----------
freemarker.template.TemplateException: Macro select has no such argument: name
	at freemarker.core.Environment.visit(Environment.java:576)
	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
	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:260)
	at com.you.test.freemarker.FreemarkerTest.testSelect(FreemarkerTest.java:233)
	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)

Macro select has no such argument: name
The problematic instruction:
----------
==> macro select [on line 1, column 1 in inc/select.ftl]
 in user-directive items.select [on line 10, column 6 in address.ftl]
----------

Java backtrace for programmers:
----------
freemarker.template.TemplateException: Macro select has no such argument: name
	at freemarker.core.Environment.visit(Environment.java:576)
	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
	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:260)
	at com.you.test.freemarker.FreemarkerTest.testSelect(FreemarkerTest.java:233)
	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、错误原因

由于select定义中没有name属性<#macro select id>,但是在引用时出现name属性

<@items.select id="city" name="city"/>,导致出现错误

3、解决办法

在引用时,删掉name属性

<@items.select id="city"/>

freemarker写select组件报错总结(二)的更多相关文章

  1. freemarker写select组件报错总结(一)

    1.具体错误如下 六月 25, 2014 11:26:29 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template pr ...

  2. freemarker写select组件报错总结(七)

    1.错误描述 六月 26, 2014 11:26:27 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template proc ...

  3. freemarker写select组件报错总结(六)

    1.错误描述 六月 26, 2014 10:53:26 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template proc ...

  4. freemarker写select组件报错总结(五)

    1.错误描述 六月 26, 2014 10:44:49 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template proc ...

  5. freemarker写select组件报错总结(四)

    1.错误描述 <html> <head> <meta http-equiv="content-type" content="text/htm ...

  6. freemarker写select组件报错总结(三)

    1.错误描述 <html> <head> <meta http-equiv="content-type" content="text/htm ...

  7. freemarker写select组件(二)

    freemarker写select组件 1.宏定义 <#macro select id datas value=""> <select id="${id ...

  8. freemarker写select组件(一)

    freemarker写select组件 1.宏定义 <#macro select id datas> <select id="${id}" name=" ...

  9. freemarker写select组件(五)

    freemarker写select组件 1.宏定义 <#macro select id datas value="" key="" text=" ...

随机推荐

  1. wpf图片浏览器,实现缩放平移操作图片切换等功能

    wpf经常要用到控件来查看图片,尤其是高清图片,于是做了一个例子: 1.定义图片的队列,用list来存. private readonly List<string> files; 2.切换 ...

  2. ASP.NET MVC 播放远程服务器上的MP3文件

    问题: 做需求遇到需要播放远程服务器上的MP3音频,使用FTP去获取文件.但是一般都是在页面 <audio> 的src 中直接写文件地址来播放音频.实在不想做临时文件,折腾了半天终于可以通 ...

  3. RandomAccess接口的使用

    RandomAccess在类Collections的shuffle()方法中的使用:(jdk源码如下) /** * Randomly permute the specified list using ...

  4. BZOJ 2780: [Spoj]8093 Sevenk Love Oimaster [广义后缀自动机]

    JZPGYZ - Sevenk Love Oimaster     Oimaster and sevenk love each other.       But recently,sevenk hea ...

  5. 在linux内核中实现自己的系统调用

    如实现一个简单的打印:printk 1.cd linux-ok6410/kernel/ vim printk.cvoid sys_pk(){printk("<0>this is ...

  6. eclipse CDT unresolved inclusion

    原因:c\c++库未设置所导致的 解决办法:1.先配置环境变量:打开window->preference->c\c++bulid->environment->add-> ...

  7. Windows下Nginx的配置及配置文件部分介绍

    一.在官网下载 nginx的Windows版本,官网下载:http://nginx.org/download/ 选择你自己想要的版本下载,解压 nginx(例如nginx-1.6.3) 包到你的win ...

  8. 模板方法模式和JDBCTemplate(一)

    本篇博客的目录: 一:模板方法模式介绍 二:模板方法模式的简单实现 三:总结 一:模板方法模式的介绍 1.1:模板方法模式的定义 定义:一个操作中的算法的骨架,而将一些步骤延迟到子类中.Templat ...

  9. Linux下配置APACHE支持PHP环境

    编辑 /usr/local/apache2/conf/httpd.conf 文件时要注意: 找到: AddType application/x-compress .Z AddType applicat ...

  10. 微信小程序内嵌网页 网站生成小程序

    1. 进入小程序后台 - 设置 - 开发设置 2. 添加业务域名(小程序只支持https) 3. 小程序代码 <web-view src="网址"></web-v ...