Error adding new line in Spring.message property
java, javascript, spring
Solution
Have you tried escaping the '\' ?
my.property.test=This is \\n my property
Problem
Hi there I´m using spring properties to localization of my text, so I have something like ``` my.property.test=This is my propery ``` Then in my Javascript I get the literal using spring.message ``` var test = <spring:message code="my.property.test"/> ``` With this scenario everything works like a charm. 'But' if I try to add a new line on the text as here: ``` my.property.test=This is my \npropery or my.property.test=This is my \n\propery ``` Browser always return me this error ``` SyntaxError: missing } after property list onCriteriaNotOpenProcedureQualificationWorksBellMessage : ''This is my --------------------------------------------------------------------------| ``` Any suggestion Solved Since is a message source, I have to use ``` <br/> ```