它应该以您想要的方式工作:
<fmt:message key="list.${myVar}"/>因为标签lib定义使该键成为表达式:fmt.tdl:
<taglib xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" version="2.0"> <description>JSTL 1.1 i18n-capable formatting library</description> <display-name>JSTL fmt</display-name> <tlib-version>1.1</tlib-version> <short-name>fmt</short-name> <uri>http://java.sun.com/jsp/jstl/fmt</uri>...<tag> <description> Maps key to localized message and performs parametric replacement </description> <name>message</name> <tag-class>org.apache.taglibs.standard.tag.rt.fmt.MessageTag</tag-class> <body-content>JSP</body-content> <attribute> <description>Message key to be looked up. </description> <name>key</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute>...
辩称在可能的应用程序中起作用的是
<%@ taglib prefix='spring' uri='http://www.springframework.org/tags'%>...<spring:message pre="myPrefix.${transaction.state}"/>


