Overriding grails.views.default.codec='html' config back to 'none'

后端 未结 6 1815
逝去的感伤
逝去的感伤 2020-12-01 00:49

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 G

6条回答
  •  春和景丽
    2020-12-01 01:33

    Write your own tag and write the expression direct to the output stream:

    class YourTagLib {
    
        static namespace = "x"
    
        def unescaped = { attrs, body ->
            out << attrs.value
        }
    
    }
    

    Use it in your GSP:

    
    

提交回复
热议问题