gpt4 book ai didi

java - 在 Freemarker 中禁用解释器

转载 作者:行者123 更新时间:2023-12-02 10:20:55 24 4
gpt4 key购买 nike

我必须在 freemarker 模板中编写一个包含大量语法的部分,这些语法可以由 freemarker 解释,但不应该。有类似 <noformat> 的东西吗?标签告诉 freemarker 不要解释给定部分中的语法?

最佳答案

有一个#noparse directive那应该做你想做的事。

FreeMarker will not search FTL tags and interpolations and other special character sequences in the body of this directive, except the noparse end-tag.

Template

Example:
--------
<#noparse>
<#list animals as animal>
<tr><td>${animal.name}<td>${animal.price} Euros
</#list>
</#noparse>

Output

Example:
--------
<#list animals as animal>
<tr><td>${animal.name}<td>${animal.price} Euros
</#list>

关于java - 在 Freemarker 中禁用解释器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54346222/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com