神秘的 J2ee 殿堂

          ·古之學者必有師·做學者亦要做師者·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"/>

          如果要在資源文件中定義一個動態的內容,像“hello:月芽兒”
          可以如下:
          message.hello=hello:{0}
          在頁面引用時傳一個參數給它就OK
          <bean:message key="message.hello" arg0="月芽兒"/>
          如果不止一個參數就{1}{2}對應arg1 arg2



          posted on 2007-09-13 15:10 月芽兒 閱讀(636) 評論(0)  編輯  收藏 所屬分類: J2EE學習心得

          導航

          統計

          常用鏈接

          留言簿(2)

          隨筆分類

          隨筆檔案

          相冊

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 乌恰县| 金沙县| 岳普湖县| 健康| 博罗县| 河东区| 土默特右旗| 于田县| 唐海县| 台东市| 柞水县| 观塘区| 江北区| 东乡县| 枣强县| 渝北区| 吉林省| 麻阳| 兴化市| 澎湖县| 尚志市| 前郭尔| 全南县| 黔西| 宜黄县| 剑阁县| 贵德县| 普洱| 文成县| 东山县| 济阳县| 汨罗市| 云梦县| 渝北区| 项城市| 桐柏县| 进贤县| 嘉善县| 长阳| 桐梓县| 凤城市|