JAVA及相关技术学习

Servlet

 

实例——创建消息资源文件

hello.jsp使用<bean:message>标签来输出文本内容。这些文件来自于Resource Bundle,每个Resource Bundle 都对应一个或多个本地化的消息资源文件。资源文件为
application.properties:
#SDFSALKFJSLAKFLAK
//#为资源文件的注释
hello.jsp.title=Hello-A first Struts program
对于JSP代码:
<bean:message key="hello.jsp.title"/>

<bea:message>标签的key属性为“hello.jsp.title”,Resource Bundle中与匹配的内容为:
hello.jsp.title=Hello-A first Struts program
因此,以上<bean:message>标签将把“Hello-A first Struts program”输出岛网页上。

posted on 2009-03-11 14:27 乱せ英豪 阅读(270) 评论(0)  编辑  收藏


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


网站导航:
 

导航

统计

常用链接

留言簿(1)

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜