[英]Comments in freemarker template and smooks
I am working on a freemarker template and here is a sample.我正在研究一个 freemarker 模板,这里是一个示例。
<Grantor>
<UniqueID>${(currentGrantorIndex)!?string}</UniqueID> // want to comment this line
<Entity>${(grantor.entityTypeName)!?string}</Entity>
</Grantor>
I want to know how to write comments or comment out few lines in freemarker templates.我想知道如何在 freemarker 模板中写评论或注释掉几行。 Any idea?
任何想法?
Comment in freemarker are delimited by <#--
and -->
. freemarker 中的注释由
<#--
和-->
分隔。 Everything between these delimiters will not be interpreted by freemarker and won't appear in the output.这些分隔符之间的所有内容都不会被 freemarker 解释,也不会出现在输出中。
<Grantor>
<#-- <UniqueID>${(currentGrantorIndex)!?string}</UniqueID> -->
<Entity>${(grantor.entityTypeName)!?string}</Entity>
</Grantor>
Another non-standard way of adding comments in freemarker using the if tag:使用 if 标签在 freemarker 中添加评论的另一种非标准方式:
<#if 1=0>comment</#if>
or或者
<#if false>comment</#if>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.