隨筆-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是默認配置文件,一些必須的框架參數都默認設置在此.
          posted on 2011-06-22 15:40 紫蝶∏飛揚↗ 閱讀(9039) 評論(3)  編輯  收藏 所屬分類: Struts1/2

          評論:
          # re: struts2 修改配置文件的默認位置報異常的解決方法[未登錄] 2011-11-30 23:59 | Tommy
          謝謝,幫我解決了一個大問題,支持你!  回復  更多評論
            
          # re: struts2 修改配置文件的默認位置報異常的解決方法 2015-06-14 13:42 | 網友
          感謝樓主。。我忘記寫struts-default。xml了  回復  更多評論
            
          # re: struts2 修改配置文件的默認位置報異常的解決方法[未登錄] 2016-03-26 15:40 | 淹死的魚
          確實能解決問題,感謝樓主  回復  更多評論
            
          主站蜘蛛池模板: 拉孜县| 凯里市| 两当县| 莱西市| 大丰市| 肥城市| 禹城市| 宣武区| 买车| 镇康县| 余姚市| 会同县| 昌图县| 剑河县| 吉隆县| 台湾省| 静乐县| 蒙山县| 民勤县| 古交市| 灌南县| 固镇县| 巴彦淖尔市| 曲麻莱县| 北川| 农安县| 永宁县| 南华县| 永川市| 晋宁县| 简阳市| 广东省| 浙江省| 金塔县| 项城市| 微博| 邵东县| 新建县| 舟曲县| 临猗县| 武平县|