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

时间:2023-01-09 20:46:52

1、错误描述

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>freemarker 下拉框</title>

  </head>

  <body>

Error parsing imported template inc/select.ftl
The problematic instruction:
----------
==> import "/inc/select.ftl" as items [on line 9, column 6 in address.ftl]
----------

Java backtrace for programmers:
----------
freemarker.template.TemplateException: Error parsing imported template inc/select.ftl
	at freemarker.core.LibraryLoad.accept(LibraryLoad.java:117)
	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.studentPrint(FreemarkerTest.java:247)
	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)
Caused by: freemarker.core.ParseException: Found unexpected directive: <#else> on line 8, column 16
Check whether you have a well-formed if-else block.
	at freemarker.core.FMParser.generateParseException(FMParser.java:4702)
	at freemarker.core.FMParser.jj_consume_token(FMParser.java:4573)
	at freemarker.core.FMParser.List(FMParser.java:1263)
	at freemarker.core.FMParser.FreemarkerDirective(FMParser.java:2380)
	at freemarker.core.FMParser.Content(FMParser.java:2623)
	at freemarker.core.FMParser.OptionalBlock(FMParser.java:2791)
	at freemarker.core.FMParser.Macro(FMParser.java:1851)
	at freemarker.core.FMParser.FreemarkerDirective(FMParser.java:2398)
	at freemarker.core.FMParser.Content(FMParser.java:2623)
	at freemarker.core.FMParser.OptionalBlock(FMParser.java:2791)
	at freemarker.core.FMParser.Root(FMParser.java:2963)
	at freemarker.template.Template.<init>(Template.java:171)
	at freemarker.cache.TemplateCache.loadTemplate(TemplateCache.java:447)
	at freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:360)
	at freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:235)
	at freemarker.template.Configuration.getTemplate(Configuration.java:578)
	at freemarker.core.Environment.getTemplateForInclusion(Environment.java:1490)
	at freemarker.core.Environment.getTemplateForImporting(Environment.java:1544)
	at freemarker.core.LibraryLoad.accept(LibraryLoad.java:112)
	... 32 more
六月 26, 2014 12:20:29 上午 freemarker.log.JDK14LoggerFactory$JDK14Logger error
严重: Template processing error: "Error parsing imported template inc/select.ftl"

Error parsing imported template inc/select.ftl
The problematic instruction:
----------
==> import "/inc/select.ftl" as items [on line 9, column 6 in address.ftl]
----------

Java backtrace for programmers:
----------
freemarker.template.TemplateException: Error parsing imported template inc/select.ftl
	at freemarker.core.LibraryLoad.accept(LibraryLoad.java:117)
	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.studentPrint(FreemarkerTest.java:247)
	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)
Caused by: freemarker.core.ParseException: Found unexpected directive: <#else> on line 8, column 16
Check whether you have a well-formed if-else block.
	at freemarker.core.FMParser.generateParseException(FMParser.java:4702)
	at freemarker.core.FMParser.jj_consume_token(FMParser.java:4573)
	at freemarker.core.FMParser.List(FMParser.java:1263)
	at freemarker.core.FMParser.FreemarkerDirective(FMParser.java:2380)
	at freemarker.core.FMParser.Content(FMParser.java:2623)
	at freemarker.core.FMParser.OptionalBlock(FMParser.java:2791)
	at freemarker.core.FMParser.Macro(FMParser.java:1851)
	at freemarker.core.FMParser.FreemarkerDirective(FMParser.java:2398)
	at freemarker.core.FMParser.Content(FMParser.java:2623)
	at freemarker.core.FMParser.OptionalBlock(FMParser.java:2791)
	at freemarker.core.FMParser.Root(FMParser.java:2963)
	at freemarker.template.Template.<init>(Template.java:171)
	at freemarker.cache.TemplateCache.loadTemplate(TemplateCache.java:447)
	at freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:360)
	at freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:235)
	at freemarker.template.Configuration.getTemplate(Configuration.java:578)
	at freemarker.core.Environment.getTemplateForInclusion(Environment.java:1490)
	at freemarker.core.Environment.getTemplateForImporting(Environment.java:1544)
	at freemarker.core.LibraryLoad.accept(LibraryLoad.java:112)
	... 32 more

Error parsing imported template inc/select.ftl
The problematic instruction:
----------
==> import "/inc/select.ftl" as items [on line 9, column 6 in address.ftl]
----------

Java backtrace for programmers:
----------
freemarker.template.TemplateException: Error parsing imported template inc/select.ftl
	at freemarker.core.LibraryLoad.accept(LibraryLoad.java:117)
	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.studentPrint(FreemarkerTest.java:247)
	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)
Caused by: freemarker.core.ParseException: Found unexpected directive: <#else> on line 8, column 16
Check whether you have a well-formed if-else block.
	at freemarker.core.FMParser.generateParseException(FMParser.java:4702)
	at freemarker.core.FMParser.jj_consume_token(FMParser.java:4573)
	at freemarker.core.FMParser.List(FMParser.java:1263)
	at freemarker.core.FMParser.FreemarkerDirective(FMParser.java:2380)
	at freemarker.core.FMParser.Content(FMParser.java:2623)
	at freemarker.core.FMParser.OptionalBlock(FMParser.java:2791)
	at freemarker.core.FMParser.Macro(FMParser.java:1851)
	at freemarker.core.FMParser.FreemarkerDirective(FMParser.java:2398)
	at freemarker.core.FMParser.Content(FMParser.java:2623)
	at freemarker.core.FMParser.OptionalBlock(FMParser.java:2791)
	at freemarker.core.FMParser.Root(FMParser.java:2963)
	at freemarker.template.Template.<init>(Template.java:171)
	at freemarker.cache.TemplateCache.loadTemplate(TemplateCache.java:447)
	at freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:360)
	at freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:235)
	at freemarker.template.Configuration.getTemplate(Configuration.java:578)
	at freemarker.core.Environment.getTemplateForInclusion(Environment.java:1490)
	at freemarker.core.Environment.getTemplateForImporting(Environment.java:1544)
	at freemarker.core.LibraryLoad.accept(LibraryLoad.java:112)
	... 32 more
六月 26, 2014 12:20:29 上午 freemarker.log.JDK14LoggerFactory$JDK14Logger error
严重: Template processing error: "Error parsing imported template inc/select.ftl"

Error parsing imported template inc/select.ftl
The problematic instruction:
----------
==> import "/inc/select.ftl" as items [on line 9, column 6 in address.ftl]
----------

Java backtrace for programmers:
----------
freemarker.template.TemplateException: Error parsing imported template inc/select.ftl
	at freemarker.core.LibraryLoad.accept(LibraryLoad.java:117)
	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:261)
	at com.you.test.freemarker.FreemarkerTest.testSelect(FreemarkerTest.java:234)
	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)
Caused by: freemarker.core.ParseException: Found unexpected directive: <#else> on line 8, column 16
Check whether you have a well-formed if-else block.
	at freemarker.core.FMParser.generateParseException(FMParser.java:4702)
	at freemarker.core.FMParser.jj_consume_token(FMParser.java:4573)
	at freemarker.core.FMParser.List(FMParser.java:1263)
	at freemarker.core.FMParser.FreemarkerDirective(FMParser.java:2380)
	at freemarker.core.FMParser.Content(FMParser.java:2623)
	at freemarker.core.FMParser.OptionalBlock(FMParser.java:2791)
	at freemarker.core.FMParser.Macro(FMParser.java:1851)
	at freemarker.core.FMParser.FreemarkerDirective(FMParser.java:2398)
	at freemarker.core.FMParser.Content(FMParser.java:2623)
	at freemarker.core.FMParser.OptionalBlock(FMParser.java:2791)
	at freemarker.core.FMParser.Root(FMParser.java:2963)
	at freemarker.template.Template.<init>(Template.java:171)
	at freemarker.cache.TemplateCache.loadTemplate(TemplateCache.java:447)
	at freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:360)
	at freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:235)
	at freemarker.template.Configuration.getTemplate(Configuration.java:578)
	at freemarker.core.Environment.getTemplateForInclusion(Environment.java:1490)
	at freemarker.core.Environment.getTemplateForImporting(Environment.java:1544)
	at freemarker.core.LibraryLoad.accept(LibraryLoad.java:112)
	... 32 more

Error parsing imported template inc/select.ftl
The problematic instruction:
----------
==> import "/inc/select.ftl" as items [on line 9, column 6 in address.ftl]
----------

Java backtrace for programmers:
----------
freemarker.template.TemplateException: Error parsing imported template inc/select.ftl
	at freemarker.core.LibraryLoad.accept(LibraryLoad.java:117)
	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:261)
	at com.you.test.freemarker.FreemarkerTest.testSelect(FreemarkerTest.java:234)
	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)
Caused by: freemarker.core.ParseException: Found unexpected directive: <#else> on line 8, column 16
Check whether you have a well-formed if-else block.
	at freemarker.core.FMParser.generateParseException(FMParser.java:4702)
	at freemarker.core.FMParser.jj_consume_token(FMParser.java:4573)
	at freemarker.core.FMParser.List(FMParser.java:1263)
	at freemarker.core.FMParser.FreemarkerDirective(FMParser.java:2380)
	at freemarker.core.FMParser.Content(FMParser.java:2623)
	at freemarker.core.FMParser.OptionalBlock(FMParser.java:2791)
	at freemarker.core.FMParser.Macro(FMParser.java:1851)
	at freemarker.core.FMParser.FreemarkerDirective(FMParser.java:2398)
	at freemarker.core.FMParser.Content(FMParser.java:2623)
	at freemarker.core.FMParser.OptionalBlock(FMParser.java:2791)
	at freemarker.core.FMParser.Root(FMParser.java:2963)
	at freemarker.template.Template.<init>(Template.java:171)
	at freemarker.cache.TemplateCache.loadTemplate(TemplateCache.java:447)
	at freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:360)
	at freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:235)
	at freemarker.template.Configuration.getTemplate(Configuration.java:578)
	at freemarker.core.Environment.getTemplateForInclusion(Environment.java:1490)
	at freemarker.core.Environment.getTemplateForImporting(Environment.java:1544)
	at freemarker.core.LibraryLoad.accept(LibraryLoad.java:112)
	... 32 more

2、错误原因

if ...else 语法错误

<#macro select id datas value="">
     <select id="${id}" name="${id}">
          <option>---请选择---</option>
          <#list datas as data>
              <#if value == data>
                 <option value="${data}" selected>${data}</option>
              </#if>
               <#else>
                 <option value="${data}">${data}</option>
          </#list>
     </select>
</#macro>

3、解决办法

正确做法:

<#macro select id datas value="">
     <select id="${id}" name="${id}">
          <option>---请选择---</option>
          <#list datas as data>
              <#if value == data>
                 <option value="${data}" selected>${data}</option>
                 <#else>
                 <option value="${data}">${data}</option>
              </#if>
          </#list>
     </select>
</#macro>

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

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

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

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

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

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

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

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

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

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

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

  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="" key="" text=" ...

  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. Linux 常用命令笔记 (持续更新)

    声明:本文是转载前辈的,地址:http://www.cnblogs.com/tovep/articles/2473147.html 在tomcat的bin目录下执行 ./shutdown.sh 为了查 ...

  2. C&plus;&plus; 什么是句柄?为什么会有句柄?HANDLE

    出处:http://www.cppblog.com/mymsdn/archive/2009/02/19/handle-in-windows.html 从广义上,能够从一个数值拎起一大堆数据的东西都可以 ...

  3. mssql 用户只能查看授权的数据库

    问题背景:公司的一台数据库服务器上放在多个数据库,每个数据库都使用不同的登录名称,但在将项目文件发布到Ftp时,有些Ftp的信息是在客户那边的 一旦客户那边使用配置文件中的数据库信息连接到数据库他就能 ...

  4. hibernate 一对多,多对一,多对多实体映射完美解决方案(再也不会糊涂了,哈哈)

  5. 8&period;nginx防DDOS

    配置详解,查看链接:http://www.myhack58.com/Article/60/sort096/2015/59453.htm 配置文件: http {         #白名单        ...

  6. linux rpm安装 failed depenencie(失败的依赖关系)错误原因

    rpm安装nfs 出现failed depenencie 经查资料得知命令后加上--nodeps --force,就可以了 加上那两个参数的意义就在于,安装时不再分析包之间的依赖关系而直接安装,也就不 ...

  7. 离线部署 pm2

    1. install nodejs curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash - 2.安装pm ...

  8. 列表中文字太多 溢出使用省略号css方法

    我们经常会遇到文字太多,而为了不打破原有布局,需要将多出文字用省略号代替,实现以下效果: 文字太太太太多多多啦...... 这个不多. html:这是个列表.ul/ol都行. <ul> & ...

  9. Power BI 与 Azure Analysis Services 的数据关联:3、还原备份文件到Azure Analysis Services

    Power BI 与 Azure  Analysis Services 的数据关联:3.还原备份文件到Azure  Analysis Services 配置存储设置 备份前,需要为服务器配置存储设置. ...

  10. Python数据类型(列表和元组)

    1.3 List(列表) 列表由一系列按特定顺序排列的元素组成. 在Python中,用方括号[ ]来表示列表,并用逗号来分隔其中的元素. 1.3.1 访问列表元素 在Python中,第一个列表元素的索 ...