隨筆-9  評論-168  文章-266  trackbacks-0
          異常:
          com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=com.opensymphony.xwork2.ObjectFactory, name='default'] in public void com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.setObjectFactory(com.opensymphony.xwork2.ObjectFactory). - Class: com.opensymphony.xwork2.inject.ContainerImpl File: ContainerImpl.java
          解決方法:
            <filter-name>struts2</filter-name>
            <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
                <init-param>  
                  <param-name>config</param-name>  
                  <param-value>struts-default.xml,struts-plugin.xml,struts2/struts-*.xml</param-value>  
              </init-param>  
           </filter>
          即,必須添加
          struts-default.xml(必須),struts-plugin.xml(可選)二個額外的配置文件.
          原因:
          struts-default.xml是默認(rèn)配置文件,一些必須的框架參數(shù)都默認(rèn)設(shè)置在此.
          posted on 2011-06-22 15:40 紫蝶∏飛揚(yáng)↗ 閱讀(9040) 評論(3)  編輯  收藏 所屬分類: Struts1/2

          評論:
          # re: struts2 修改配置文件的默認(rèn)位置報異常的解決方法[未登錄] 2011-11-30 23:59 | Tommy
          謝謝,幫我解決了一個大問題,支持你!  回復(fù)  更多評論
            
          # re: struts2 修改配置文件的默認(rèn)位置報異常的解決方法 2015-06-14 13:42 | 網(wǎng)友
          感謝樓主。。我忘記寫struts-default。xml了  回復(fù)  更多評論
            
          # re: struts2 修改配置文件的默認(rèn)位置報異常的解決方法[未登錄] 2016-03-26 15:40 | 淹死的魚
          確實(shí)能解決問題,感謝樓主  回復(fù)  更多評論
            
          主站蜘蛛池模板: 密云县| 稷山县| 二手房| 福清市| 福建省| 津市市| 灵川县| 太仆寺旗| 玛沁县| 开江县| 财经| 辽阳县| 灵川县| 定陶县| 图木舒克市| 杭州市| 奉化市| 扎赉特旗| 长治县| 万全县| 富蕴县| 蒲江县| 赣榆县| 栾城县| 绥江县| 乃东县| 铅山县| 塘沽区| 乐安县| 乌鲁木齐市| 沙坪坝区| 苏尼特左旗| 鲜城| 凤阳县| 江陵县| 小金县| 高清| 本溪| 芜湖县| 黑河市| 内乡县|