In my jsp, I would show a message when I select an option, this message is loaded from a properties files. For example:
In props I have:
msg.01=Message 1
msg.02=Message 2
...
In Jquery code, I get the value of the selected option:
$("#optionId').val()
And with Struts bean:message tag:
alert("<bean:message
bundle='Message'`key='msg."+$("#clientTypeId').val()"+'/>");
The alert message showed is always:
???en.msg.0x??? (x is 0 or 1 or ...)
Have any idea about my problem please?
Thanks!
You can’t use JSTL when executing Javascript. What I would do is use JSTL to generate a Javascript object, for example:
Now you can get a message from the Javascript object: