jsp - Format Spring:message argument -
how can format arguments of <spring:message>
?
i have message this:
message.mymessage=this {0} message {1} {2} multiple arguments
my jsp has following:
<spring:message code="message.mymessage" arguments="<fmt:formatnumber value='${value1}' currencysymbol='$' type='currency'/>,${value2},${value3}" htmlescape="false"/>
which doesn't display value1
, number formatted.
i not sure can add fmt tag inside argument list.
the arguments
attribute of <spring:message>
can contain jsp el expressions, not jsp tags.
try un-nesting it. can assign result of <fmt:formatnumber>
variable, e.g.
<fmt:formatnumber var="formattedvalue1" value='${value1}' currencysymbol='$' type='currency'/> <spring:message code="message.mymessage" arguments="${formattedvalue1},${value2},${value3}" htmlescape="false"/>
Comments
Post a Comment