I have 3 properties defined in my resource bundle:
test.key1 = Just a normal snippet.
test.key2 = snippet with {0} arguments {1}.
test.key3 = snippet with 'charac'ter'.
test.key4 = snippet with {0} arguments' and 'characters {1}.
Here's how I access them in my jsp:
<spring:message code="test.key1"/>
<spring:message code="test.key2" arguments="ARG1,ARG2"/>
<spring:message code="test.key3"/>
<spring:message code="test.key4" arguments="ARG1,ARG2"/>
Rendered they look like this:
Just a normal snippet.
snippet with ARG1 arguments ARG2.
snippet with 'charac'ter'.
snippet with ARG1 arguments and characters {1}.
So basically what happens is: As soon as a '
(single quote) character appears, the arguments are no longer filled in AND the single quotes are not rendered anymore. The funny thing is spring has no problems when arguments or single quotes are applied separately.
I was able to fix test scenario 4 by using 2x single quotes like this:
test.key4 = snippet with {0} arguments'' and ''characters {1}.
Which correctly renders too
snippet with ARG1 arguments' and 'characters ARG2.
Of course this a maintenance nightmare: all properties that have single quotes in them but NO arguments should have 1x the single quotes, and all properties that have both single quote characters and arguments in them require 2x single quote.
Why is this, and is there a way to fix this undesired behaviour?