NewMoring

          與Java同路,贏在未來。

          統計

          積分與排名

          http://bbs.javawind.net/index.jspx

          http://www.chubeibao.com/bbs/index.php

          http://www.java2000.net/

          http://www.javaeye.com/

          http://www.javathinker.org/index.jsp

          http://www.programbbs.com/bbs/index.asp

          最新評論

          Cannot find message resources under key org.apache.struts.action.MESSAGE錯誤

          運行程序出現Cannot find message resources under key org.apache.struts.action.MESSAGE錯誤,是說明找不到ApplicationResources.properties,要注意以下四方面。

            第一:在web.xml文件<web-app> <servlet>"把下面的內容放在這里"</servlet></web-app>中加入

              <init-param>
              <param-name>application</param-name>
              <param-value>ApplicationResources</param-value>
              </init-param>

            第二:在struts-config.xml中加入如下設置:

             <message-resources parameter="ApplicationResources"/>

              該設置最好放在:</action-mappings>"放到這里"</struts-config>

            第三:確保ApplicationResources.properties文件在你建立的WEB-INF\classes文件夾中。

            可以把applicationResources.properties放到classes文件夾下其它目錄,例如:
            把ApplicationResources.properties放入WEB-INF\classes\mydir文件夾下。struts-config.xml中的設置必須改

               <message-resources parameter="mydir/ApplicationResources"/>
            
              第四:就可能是鍵值的問題,struts的資源文件也是可以分多資源文件配置的,比如配備是這樣的

              <message-resources parameter="ApplicationResources" key="myAppRes"/>      

             如果只有一個帶key的資源文件,那就會拋出 org.apache.struts.action.MESSAGE錯誤了,刪除key即可。

          posted on 2009-06-01 16:15 清晨 閱讀(1103) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 宜城市| 怀集县| 元朗区| 临湘市| 左云县| 佛教| 兴义市| 绵阳市| 晋州市| 高邑县| 钦州市| 临江市| 瑞金市| 玉林市| 定边县| 江城| 宁海县| 金山区| 珠海市| 庄浪县| 吉木萨尔县| 周至县| 宁河县| 鄂温| 甘孜| 石屏县| 肥西县| 贵南县| 庆阳市| 新乡县| 天长市| 定安县| 西丰县| 清新县| 新平| 秦皇岛市| 措勤县| 康保县| 临泉县| 新昌县| 南昌市|