我有一个Map<String, Object>,它包含字符串、双数、整数、布尔和null (缺失)作为值。我想在FreeMarker模板中打印出这个值。
当我使用${data[field]!?html}时,它适用于所有其他变量,但在布尔值上崩溃的有:
freemarker.core._MiscTemplateException: Can't convert boolean to string automatically, because the "boolean_format" setting was "true,false", which is the legacy default computer-language format, and hence isn't accepted.该应用程序是一个管理UI,在这里,我不太关心确切的格式,但我更希望布尔人使用标准的true和false。( boolean_format标志控制布尔人的标准格式,但使用true和false似乎是令人难以置信的原因的明令禁止。)
什么是最好的方式来绕过FreeMarker抑制?
https://stackoverflow.com/questions/52381678
复制相似问题