Java 访问动态资源消息
在我的Jsp中,我有用于Java 访问动态资源消息,java,spring,jsp,spring-mvc,internationalization,Java,Spring,Jsp,Spring Mvc,Internationalization,在我的Jsp中,我有用于 typeA typeB typeC typeD 我使用了以下标签: <c:forEach var="abcTyp" items="${abcTypeList}"> <form:radiobutton path="abcType" value="<spring:message code="label.admin.lot.${abcType.value}" />" label="${abcTyp.value}" onclick
typeA
typeB
typeC
typeD
我使用了以下标签:
<c:forEach var="abcTyp" items="${abcTypeList}">
<form:radiobutton path="abcType" value="<spring:message code="label.admin.lot.${abcType.value}" />" label="${abcTyp.value}" onclick="actSingStone();"/>
</c:forEach>
但它给出了一个错误“预期相等符号”
有人能给我同样的解决方案吗…?尝试将标签设置为变量并使用它,如下所示
<c:forEach var="abcTyp" items="${abcTypeList}">
<c:set var="labelVar">
<spring:message code="label.admin.lot.${abcType.value}" />
</c:set>
<form:radiobutton path="abcType" label="${labelVar}" value="${abcTyp.value}" onclick="actSingStone();"/>
</c:forEach>
label.admin.pep.typeA = some text
label.admin.pep.typeB = some text
label.admin.pep.typeC = some text
label.admin.pep.typeD = some text
<c:forEach var="abcTyp" items="${abcTypeList}">
<c:set var="labelVar">
<spring:message code="label.admin.lot.${abcType.value}" />
</c:set>
<form:radiobutton path="abcType" label="${labelVar}" value="${abcTyp.value}" onclick="actSingStone();"/>
</c:forEach>