您好,我正在使用 spring 属性来本地化我的文本,所以我有类似的内容
my.property.test=This is my propery
然后在我的 Javascript 中,我使用 spring.message 获取文字
var test = <spring:message code="my.property.test"/>
在这种情况下,一切都很顺利。 '但是'如果我尝试在文本上添加新行,如下所示:
my.property.test=This is my \npropery
or
my.property.test=This is my \n\propery
浏览器总是返回此错误
SyntaxError: missing } after property list
onCriteriaNotOpenProcedureQualificationWorksBellMessage : ''This is my
--------------------------------------------------------------------------|
任何建议
已解决
由于是消息源,所以我必须使用
<br/>
最佳答案
您是否尝试过转义“\”?
my.property.test=This is \\n my property
关于java - 在 Spring.message 属性中添加新行时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28748374/