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

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -