I am currently working on a spring project, and I had to use fmt tags inside my JSPs. In fact fmt tags are working fine for me, and its reading the right value from messages.properties file.
for example:
<fmt:message key="General.Settings"/>
in the .properties file:
General.Settings=Settings
it reads it just perfect.
Now, the issue exists when puting the fmt tag inside another JSTL tags.
For example:
<input name="commit" value= <fmt:message key="AllMessages.PostThisMessage"/>
type="submit" onclick="return isEmpty();" />
Inside .properties file:
AllMessages.PostThisMessage=Post this message
but it displays only the word “Post” instead of “Post this message”
and same with all other fmt tags inside other JSTL tags.
any suggestions?
Don’t nest your tags like that, it’s confusing and error-prone. Better to do this sort of thing:
If you really were using this syntax:
Then it’s a marvel it worked at all, since that would generate invalid HTML.