神秘的 J2ee 殿堂

          ·古之學(xué)者必有師·做學(xué)者亦要做師者·FIGHTING·

          Struts Message Resources小記

          配置Message Resources的兩種方式:
          1.在web.xml中配
          <servlet>
          <servlet-name>action</servlet-name>
          <servlet-class>
              org.apache.struts.action.ActionServlet
          </servlet-class>
          <init-param>

          <param-value>
              com.hunau.liuyong.struts.ApplicationResources
          </param-value>

          </init-param>
          </servlet>

          2.在struts-confg.xml中
          <message-resources parameter="com.hunau.liuyong.struts.ApplicationResources"/>

          如果要在資源文件中定義一個(gè)動(dòng)態(tài)的內(nèi)容,像“hello:月芽?jī)?#8221;
          可以如下:
          message.hello=hello:{0}
          在頁(yè)面引用時(shí)傳一個(gè)參數(shù)給它就OK
          <bean:message key="message.hello" arg0="月芽?jī)?/span>"/>
          如果不止一個(gè)參數(shù)就{1}{2}對(duì)應(yīng)arg1 arg2



          posted on 2007-09-13 15:10 月芽?jī)?/a> 閱讀(636) 評(píng)論(0)  編輯  收藏 所屬分類: J2EE學(xué)習(xí)心得

          導(dǎo)航

          統(tǒng)計(jì)

          常用鏈接

          留言簿(2)

          隨筆分類

          隨筆檔案

          相冊(cè)

          搜索

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 泰安市| 琼中| 郴州市| 宁陵县| 疏勒县| 乐陵市| 榕江县| 洛扎县| 河西区| 德令哈市| 循化| 和林格尔县| 南召县| 九台市| 格尔木市| 永兴县| 沈阳市| 潼南县| 廊坊市| 富锦市| 昌都县| 休宁县| 自贡市| 故城县| 泌阳县| 应城市| 同仁县| 丰台区| 新干县| 平和县| 宁远县| 舞钢市| 桐柏县| 明溪县| 社旗县| 杭锦后旗| 大洼县| 万山特区| 镇远县| 巨野县| 海盐县|