mailconfirm.mail.body=Hi, {0}!
\\
To confirm your email address click on the confirmation
Spring's ResourceBundleMessageSource
(which I think you are using) uses MessageFormat
for replacing placeholders ({0}
) inside messages. MessageFormat
requires that single quotes ('
) are escaped using two single quotes (''
) (see: MessageFormat Javadoc).
However, by default messages that do not contain any arguments will not be parsed by MessageFormat
. So single quotes in messages without arguments don't need to be escaped.
ResourceBundleMessageSource
provides a flag called alwaysUseMessageFormat
that can be used if MessageFormat
should be applied to all messages. So a single quote need always be escaped by two single quotes.
See this blog post for more details.