StringTemplate删除< >作为分隔符 [英] StringTemplate remove < > as delimiters
问题描述
我试图在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删除< >作为分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!