87214551 2013-05-15
If in a template <td>${attribute.value}</td> is used, and value is boolean, the following exception is thrown:
freemarker.core.NonStringException: Error on line 19, column 3 in description.ftl
Expecting a string, date or number here, Expression a.value is instead a freemarker.ext.beans.BooleanModel
- quote: "..Unlike numbers, booleans has no commonly accepted format, not even a
common format within the same page. Like when you show on a HTML page.."
"...The common way of formatting a boolean is like ${washable?string("yes", "no")},
${caching?string("Enabled", "Disabled")}, ${heating?string("on", "off")}, etc..."
- By the other hand, the Features used in the unit test for FeatureTemplate contained no boolean properties. Adding a boolean property to the test data still didn't make the error to show up, as the template used uses <td>${attribute.value.toString()}</td>. Changing the template to use <td>${attribute.value}</td> exposes the error.
是一个替代hibernate的一个作用于数据库的框架。 这里整合后不需要写一些简单的sql语句。 2、在resources下创建templates文件夹,在其下就可以书写页面了,和HTML的风格相似。