If the message is a JavaScript string literal, for example, in
<script>
function sayI18nedHello() {
alert('<spring:message javaScriptEscape="true" code="hello" />');
}
</script>
You will then need this attribute, which avoids single and double quotes, newlines, tabs, etc., to ensure that the generated JavaScript is valid.
source
share