1

I have this spring macro

[@spring.formSingleSelect path="discoveryProjectDetailsBean.discoveryProjectBean.dataSource" options="dataSources" /]

it throws exception freemarker.template.TemplateException: Expected collection or sequence. options evaluated instead to freemarker.template.SimpleScalar on line 227, column 20 in spring.ftl. at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:135)

this happens because it cannot interpret the dataSource list as sequence.

any help

4

1 回答 1

2

现在我从来没有发现更难的问题,上面的这个异常是因为dataSource我试图设置为选项列表的列表不是纯字符串列表。所有要传递给的选项列表@spring.formSingleSelect我还在这里找到了另一个参考 ,就像我现在使用的工作标签的代码片段一样,如下所示。

[@spring.bind "dataSources"/]     
[@spring.formSingleSelect "discoveryProjectDetailsBean.discoveryProjectBean.dataSource" dataSources "disabled='disabled' multiple='multiple' class='singleList' onchange='checkValidations()'" /]

我希望这会对某人有所帮助

于 2012-11-19T16:20:58.657 回答