惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
IT之家
IT之家
D
Docker
博客园 - 叶小钗
A
About on SuperTechFans
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
Recorded Future
Recorded Future
Stack Overflow Blog
Stack Overflow Blog
腾讯CDC
V
V2EX
S
SegmentFault 最新的问题
量子位
P
Proofpoint News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
Latest news
Latest news
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
有赞技术团队
有赞技术团队
The GitHub Blog
The GitHub Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
I
InfoQ
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
DataBreaches.Net
G
GRAHAM CLULEY
P
Proofpoint News Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Y
Y Combinator Blog
小众软件
小众软件
NISL@THU
NISL@THU
L
Lohrmann on Cybersecurity
aimingoo的专栏
aimingoo的专栏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
I
Intezer
Last Week in AI
Last Week in AI
T
Threatpost
人人都是产品经理
人人都是产品经理
U
Unit 42
Security Latest
Security Latest
AWS News Blog
AWS News Blog
T
The Blog of Author Tim Ferriss
MongoDB | Blog
MongoDB | Blog
罗磊的独立博客
GbyAI
GbyAI
P
Palo Alto Networks Blog
G
Google Developers Blog
MyScale Blog
MyScale Blog
L
LangChain Blog

博客园 - wishma

SOAR平台初探(一) Logstash和Flume-NG Syslog接收小测试 Elasticsearch 填坑记 IBM TBSM 业务关联规则配置一例 免费实用微软系统工具集推荐(转) Netcool/OMNIbus Probe脚本编写例子(1) VMware vSphere开发(2)配置VMware vSphere Web Services SDK的开发环境 VMware vSphere开发(1)安装配置VMware vSphere Web Services SDK的运行环境 数字电视业务PSI/SI学习系列(转) SMI-S存储管理协议资料 IPhone数据库操作代码例子 NSDate常用代码范例 64位windows7连接网络共享打印机的问题 IPhone 视图切换的的2种方法 我的D630,安装MAC经历 Eclipse快捷键大全(转贴) (转贴)JIRA安装和破解,随便看看吧 CentOS上安装Tomcat,切换JDK的方法 哥不是间谍,哥只是在找信号!(转贴有意思)
strus2格式化数字和日期(转) - wishma - 博客园
wishma · 2010-12-29 · via 博客园 - wishma

strus2格式化数字和日期

文章分类:Java编程

先在class目录下建资源文件(根据实际情况加相应内容)如:applicationResource_zh_CN.properties中
format.number.money = {0,number,###,###.00}
global.format.datetime = {0, date, yyyy-MM-dd HH:mm:ss}
global.format.date = {0, date, yyyy-MM-dd}

struts.xml中加上
<constant name="struts.custom.i18n.resources" value="applicationResource"></constant>

页面上用
<s:text name="format.number.money">
   <s:param value="值"/>
</s:text>

<s:text name="global.format.datetime">
   <s:param value="obj.sj"/>
</s:text>

其它方法
<s:date name="#request.time" format="yyyy-MM-dd"/>

<input type="text" name="time1" value="<s:date format="yyyy-MM-dd" name="#request.time"/>">

<s:textfield name="#request.sys.time" >
        <s:param name="value"><s:date name="#request.time" format="yyyy-MM-dd"/></s:param>
</s:textfield>

<s:textfield name="time" value="%{getText('global.format.date',{#request.time})}" />