覆盖grails.views.default.codec ='html'config回到'none' [英] Overriding grails.views.default.codec='html' config back to 'none'
问题描述
在Grails(< 2.3)中,如果我在Grails Config.groovy中留下 grails.views.default.code ='none'
,则由我决定HTML在GSP文件中显式编码我的表达式: $ {myValue?.encodeAsHTML()}
。
在Config.groovy中设置 grails.views.default.codec ='html
,那么HTML编码会针对每个表达式自动进行: $ {myValue我的问题:如果我将默认设置为
。'html'
,
如果默认编码级别设置为html使用
grails.views.default.codec = html
然后删除您可以使用的页面中的一个表达式的html编码
$ {raw(expression)}
In Grails (<2.3), if I leave grails.views.default.code='none'
in the grails Config.groovy, it's up to me to HTML encode my expressions explicitly in the GSP files: ${myValue?.encodeAsHTML()}
.
If I set grails.views.default.codec='html"
in the Config.groovy, then the HTML encoding happens automatically for every expression: ${myValue}
.
My question: If I set the default to 'html'
, how do I get back to 'none'
for one expression when I don't want the HTML encoding behavior?
If default encoding level is set to html using
grails.views.default.codec = "html"
then for removing the html encoding for one expression in a page you can use
${raw(expression)}
这篇关于覆盖grails.views.default.codec ='html'config回到'none'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!