Create a Global message property so that the formating can be applied to all the pages name it globalMessages.properties
item.listprice = {0,number,$##0.00}
Now add the property to struts.properties
struts.custom.i18n.resources=globalMessages
Now how to Call the formating string in JSP
where listprice comes from the stack and the formating string from the global resource we set earlier.
<s:text name="%{getText('item.listprice')}">
<s:param name="value" value="listprice"/>
</s:text>
And now the Output
$12.20
Make sure to put the property files in the correct folder of your project.
0 Comments:
Post a Comment