I have messages in properties file and reading these properties file using spring and spring message tag,
For example I have :
key.red=Red<br>
key.blue= blue
blue message text coming as "blue" but not as " blue". The leading white spaces are taken out by spring:message tag.
how could i retain leading space ? I appreciate any help
Thanks,
Sri
'\\' - add escape character. '\ ' - add space in a key or at the start of a value.
The properties files are processed in the order in which they appear on the command line. Each properties file can refer to properties that have already been defined by a previously processed properties file, using ${varname} syntax.
In my case, two leading '\\' working fine for me.
Try doing it like this:
key.blue=\u0020blue
You can use other unicode codes to escape characters as well. All per Java API doc. Quote:
...Characters that cannot be directly represented in this encoding can be written using Unicode escapes ....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With