`

struts配置问题

 
阅读更多


ERROR:
No mapping found for dependency [type=com.opensymphony.xwork2.ObjectFactory, nam

问题原因:应该是你的struts.xml 中没有引入struts-default.xml文件。
解决方法:在 <struts> 节点下加上 <include file="struts-default.xml"/> 就可以了。
或都在web.xml中, <filter>
  <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,modules/struts.xml,modules/**/struts-conf/struts-*.xml</param-value>
     </init-param>

</filter>
红色(struts-default.xml,struts-plugin.xml):是struts2需要加载的.xml文件, modules/struts.xml,modules/**/struts-conf/struts-*.xml:自己项目的配置文件
0
3
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics