I'm trying to show é
as a title of my form:input
field, and I can't get it working.
Example 1 :
<form:input type="text" path="something" title="é"/>
Output :
Example 2 :
<input type="text" title="<spring:message code="mySpecialChar" />"/>
Output :
Example 3 :
<form:input type="text" path="something" title="<spring:message code="mySpecialChar" />"/>
Output :
Error, I'm not allowed to do that, to solve this, I've tried Example 4.
Example 4 :
<spring:message code=mySpecialChar" var="mySpecialChar"/>
<form:input type="text" path="something" title="${mySpecialChar}"/>
Output :
How can I get my Example 4 working properly ?
After a quick search, I've found that I have to add
htmlEscape="false"
to my<spring:message>
tag.Spring:message docs
You would need to unescape your value in a Controller, first thing you would have to autowire your MessageSource
than you can unescape using e.g. StringEscapeUtils
than just