playframework 1.2. insert raw html into template?

人盡茶涼 提交于 2019-12-23 10:50:36

问题


Assume the template consists of only one variable:

${htmlString}

and the corresponding Controller:

render("<div>some html markup</div>");

As a result i get an escaped string, but want to get the original html. Is there any way to do this?


回答1:


You can use ${mystring.raw()} i think. Or embed it inside a #{verbatim} tag. -morten




回答2:


In the Play2 template engine the escaping is done like this:

@Html("\n<br>")

(Source)



来源:https://stackoverflow.com/questions/7919256/playframework-1-2-insert-raw-html-into-template

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!