I am doing a Spring web application. In my messages.properties file, there is a one-line string as follows:
label.name.tooltip=The "name" field ...
My JSP file displays this string as follows:
<spring:message code="label.name.tooltip" />
However, the displayed text is only "The", which means the part from "name" is cut.
I dont know why this happens. Googled and the ways such as adding a backslash before double quotes are not working.
Regards and thanks!
Update
The whole problem was caused by me using the string in the title attribute of A tag as follows:
a href="#" data-toggle="tooltip" title="<spring:message code="label.name.tooltip" />
As Bossie hinted, the browser removes the string content starting from the double quote.
Misha did quite an explanation, which helped me to understand more about how the message works. Thanks, Misha!!!
I found a solution at SO that in my case, use "name" instead of double quotes. Hope this helps someone else.