freemark遍历list报错:
list:
xml配置文件:
<#list list as obj>
INSERT INTO fd_motor_style(style_value, motor_id) VALUES('${obj.v}', ${obj.k})
</#list>
报错:
Expected collection or sequence. list evaluated instead to freemarker.template.SimpleScalar on line 1, column 8 in RAM_TEMPLATE.
The problematic instruction:
----------
==> list list as obj [on line 1, column 1 in RAM_TEMPLATE]
----------
Java backtrace for programmers:
----------
freemarker.template.TemplateException: Expected collection or sequence. list evaluated instead to freemarker.template.SimpleScalar on line 1, column 8 in RAM_TEMPLATE.
at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:135)
at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:190)
at freemarker.core.Environment.visit(Environment.java:416)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
at freemarker.core.Environment.visit(Environment.java:209)
at freemarker.core.Environment.process(Environment.java:189)
at freemarker.template.Template.process(Template.java:237)
at com.fanda.core.freemarker.utils.FreeMarkerUtil.process(FreeMarkerUtil.java:217)
at com.fanda.core.freemarker.utils.FreeMarkerUtil.process(FreeMarkerUtil.java:198)
at com.fanda.core.commonquery.config.QueryConfig.getSqlInfo(QueryConfig.java:190)
at com.fanda.core.commonquery.config.QueryConfig.getSqlInfo(QueryConfig.java:183)
at com.fanda.core.helper.CommonQueryHelper.executeQuery(CommonQueryHelper.java:225)
at com.fanda.core.helper.CommonQueryHelper.executeQuery(CommonQueryHelper.java:263)
at com.fanda.core.module.res.query.QueryResourceType$QueryResourceHttpDispatcher.dispatch(QueryResourceType.java:119)
at com.fanda.core.module.res.query.QueryResourceType$QueryResourceHttpDispatcher.dispatch(QueryResourceType.java:1)
at com.fanda.core.module.runtime.Module.dispatch(Module.java:90)
at com.fanda.core.module.runtime.Module.dispatchResource(Module.java:80)
at com.fanda.core.module.dispatch.ModuleDispatchFilter.doFilter(ModuleDispatchFilter.java:80)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.fanda.core.filter.CoreFilter.doFilter(CoreFilter.java:174)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2503)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2492)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
报错好啊
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。