开发者

Specifying form checkbox value with spring message

开发者 https://www.devze.com 2023-03-16 15:30 出处:网络
Can I specify the form:checkbox tag value with spring:message tag? Seems like a silly questio开发者_开发技巧n, but it seems hard to find the right syntax, if there\'s any.Something like this should wo

Can I specify the form:checkbox tag value with spring:message tag? Seems like a silly questio开发者_开发技巧n, but it seems hard to find the right syntax, if there's any.


Something like this should work:

<fmt:message key="myKey" var="myLabel" />
<form:checkbox path="foo"
id="${commandName.foo}" 
label="${myLabel}"
value="${commandName.foo}" />

where myKey is the key you'd use in <spring:message code="myKey"/>

0

精彩评论

暂无评论...
验证码 换一张
取 消