異常:
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
紫蝶∏飛揚↗ 閱讀(9027)
評論(3) 編輯 收藏 所屬分類:
Struts1/2