I’m using Struts 1.2 and I need to reference the value of some internationalized strings in a JSP page. Normally I would do this using the < bean:message > tag, but I need to reference it from the Java code (surrounded by <% … %>) instead.
How can I do this?
For example:
<%
person.setName("John Smith");
person.setOccupation("Chef"); // I want to internationalize this string
%>
I think this is one way to do it.
Inside struts-config.xml, if you have the following:
Then you do the following:
At the top of the JSP:
Somewhere in the JSP: