How to output ${expression} in Freemarker without it being interpreted?

后端 未结 8 1180
隐瞒了意图╮
隐瞒了意图╮ 2020-12-05 06:39

I\'m trying to use Freemarker in conjunction with jQuery Templates.

Both frameworks use dollar sign/curly brackets to identify expressions for substitution (or as th

8条回答
  •  余生分开走
    2020-12-05 07:20

    I had to spent some time to figure out the following scenarios to escape ${expression} -

    • In Freemarker assignment:

    <#assign var = r"${expression}">

    • In html attribute:

    Some link

    • In Freemarker concatenation:

    <#assign x = "something&"+r"${expression}"/>

提交回复
热议问题