输出带有占位符的国际化信息getText("welcome",new String[]{"liming","study"})

资源文件中的内容如下:
Welcome
={0},欢迎来到中国{1
1在JSP页面中输出带有占位符的国际化信息
<s:text name=”welcome”>
    
<s:param><s:property  value=”realname”/></s:param>
    
<s:param>学习</s:param>
</s:text>
example:
<s:text name="welcome">
       
<s:param>liming</s:param>
       
<s:param>study</s:param>
   
</s:text> <br>
2
在Action类中获取带占位符的国际化信息,可以使用getText(String key  , String[]args )
或getText(String  aTextName,List args)
example:
ActionContext.getContext().put(
"message"this.getText("welcome",new String[]{"liming","study"}));

posted on 2012-06-07 23:00 youngturk 阅读(578) 评论(0)  编辑  收藏 所属分类: Struts


只有注册用户登录后才能发表评论。


网站导航:
 
<2012年6月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

导航

统计

公告

this year :
1 jQuery
2 freemarker
3 框架结构
4 口语英语

常用链接

留言簿(6)

随笔分类

随笔档案

文章分类

文章档案

相册

EJB学习

Flex学习

learn English

oracle

spring MVC web service

SQL

Struts

生活保健

解析文件

搜索

最新评论

阅读排行榜

评论排行榜