Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error adding new line in Spring.message property

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/>
like image 791
paul Avatar asked Sep 19 '26 06:09

paul


1 Answers

Have you tried escaping the '\' ?

  my.property.test=This is \\n my property
like image 78
Harijoe Avatar answered Sep 20 '26 20:09

Harijoe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!