grails - 如何转换gsp中的原始br来中断行?

标签 grails gsp

在我的gsp页面中是以下代码

<p>

        ${ confirmationTemplate?.body?.replace('\n', '<br/>') }


    </p>

页面呈现如下
> Dear Participant, <br/> <br/>Thanks for registering to our event. The
> event will start shortly. <br/> <br/>Please collect your bibs before
> the race. <br/> <br/>Cheers, <br/>Swat Kats


不应该打印,但是会引起换行。我怎么解决这个问题?感谢您的帮助!谢谢!

最佳答案

    <%request.setAttribute("vEnter", "\n");%>
    ${fn:replace(blindItem.blindShowModeStr,vEnter,"<BR />") }

关于grails - 如何转换gsp中的原始br来中断行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43317231/

相关文章:

grails - 如何使用Grails 2.4.3在Spring Security Rest中实现切换用户

templates - Grails和gsp : How to render nested template with the same model/bean?

sql - Grails:创建动态 SQL 连接

grails - g:grails中的select标记不在目标字段中存储列表元素的关键字

grails - 如何从 gsp 调用 Grails 服务?

json - <g:select>键具有json数据->在gsp垃圾中输出

grails - 如何在Grails中呈现来自api的html响应

javascript - 我在保存日期和时间时遇到问题?

security - Grails + Acegi : How to handle password renewal ? 登录与未登录用户

使用 Tomcat 的 CentOS Grails 应用程序的 Apache 重写规则