struts2 全局格式化,格式化时间,金钱,数字

//在前台页面去控制时间,数字,小数,金钱,是极其不明智的选择,除非你是写了良好的  js  api
像freemarker , struts  都有良好的标签,我们应该好好利用,才发现的,给大家分享一下


单独的properties 文件  for example,a.properties
format.time = {0,time}
format.number = {0,number,#0.0##}
format.percent = {0,number,##0.00'%'}
format.money = {0,number,u00A4##0.00}

struts.xml
配置
<constant name="struts.custom.i18n.resources" value="a"></constant>


页面输出
<s:text name="format.money">
    <s:param name="value" value="myMoneyValue"/>
</s:text>



当然以上信息来自官网,翻译一下而已

补充点东西



原文地址:https://www.cnblogs.com/pangblog/p/3275805.html