I have several properties in the properties file that need to be translated into different languages:
list.var1=XXX
list.var2=XXX
list.var3=XXX
They are list values, so in JSP I want to get the translated value. Therefore, I have a property, for example, myVar, whose values ββcan be {var1, var2, var3}, and I want to get the message "list. $ {MyVar}".
The problem is that in the fmt: message tag, the key attribute does not accept expressions.
<%@ taglib prefix="fmt" uri="java.sun.com/jstl/fmt" %>
<fmt:message key="list.${myVar}"/>
What is the best way to do this?
Thank.
source
share