在grails中我不想用gsp作显示,我想用html作显示应该怎么办
可以的,不过我没有试过。
1:在grails-app/utils/下创建HTMLCodec.groovy,在其中的decode方法中进行反转:
static decode = { theTarget ->
org.springframework.web.util.HtmlUtils.htmlUnescape(theTarget.toString())
}
页面上需要显示html的地方调用decodeHTML(),则转义后的html代码自动反转回来。