StringTemplate删除< >作为分隔符 [英] StringTemplate remove < > as delimiters

查看:117
本文介绍了StringTemplate删除< >作为分隔符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在java web应用程序中使用StringTemplate来生成html电子邮件。当试图输入换行符时,我使用 \< br \> 这似乎不起作用。 \< b \> 不能正常工作。有没有办法关闭<和>作为分隔符,所以我可以测试这是否是问题?在整个StringTemplate文档中,它表示使用$ ... $作为分隔符,但并未说明如何不使用< ...>

解决方案

创建组时,您可以使用

  STGroup group = new STGroupDir(emails ,'$','$'); 

其中'$'和'$'是您的分隔符。

I am trying to use StringTemplate in a java web app to generate html emails. When trying to enter line breaks, I use \<br\> This does not seem to be working. \<b\> is not working as well. Is there a way to turn off < and > as delimiters so I can test if this is the issue? All over the StringTemplate documentation it says to use $...$ as your delimiters but doesn't say how to not use <...>

解决方案

When creating a group you can set the delimiters by using

STGroup group = new STGroupDir("emails", '$','$');

Where '$' and '$' are your delimiters.

这篇关于StringTemplate删除&lt; &GT;作为分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆