Today in the integration of spring+struts, put struts2 configuration file to Src/config/struts/struts.xml, start the project always error! The web under the Struts interceptor is configured as follows:
<!--define the core of STRUTS2 filter--
<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>config/struts/struts.xml</param-value>
</init-param>
</filter>
<!--let Struts2 's core filter intercept all requests--
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
The operation is always wrong, the whole day before the whole. The eclipse error is as follows:
com.opensymphony.xwork2.inject.dependencyexception: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).
At Com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers (containerimpl.java:144)
At Com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMethods (containerimpl.java:113)
At Com.opensymphony.xwork2.inject.ContainerImpl.addInjectors (containerimpl.java:90)
At Com.opensymphony.xwork2.inject.ContainerImpl.addInjectors (containerimpl.java:86)
At Com.opensymphony.xwork2.inject.containerimpl$1.create (containerimpl.java:71)
At Com.opensymphony.xwork2.inject.containerimpl$1.create (containerimpl.java:67)
At Com.opensymphony.xwork2.inject.util.referencecache$callablecreate.call (referencecache.java:150)
At Java.util.concurrent.FutureTask.run (futuretask.java:262)
At Com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate (referencecache.java:76)
At Com.opensymphony.xwork2.inject.util.ReferenceCache.get (referencecache.java:116)
At Com.opensymphony.xwork2.inject.ContainerImpl.inject (containerimpl.java:483)
At Com.opensymphony.xwork2.inject.containerimpl$6.call (containerimpl.java:523)
may be to be unable to struts-default.xml and error!
There are two ways to modify a scenario:
Scenario 1, add the content in Struts2.xml:
<include file= "Struts-default.xml"/>
Scenario 2, modify the Struts interceptor configuration under the Web, as follows:
<!--define the core of STRUTS2 filter--
<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,config/struts/struts.xml</param-value>
</init-param>
</filter>
<!--let Struts2 's core filter intercept all requests--
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Struts configuration file Modification path error