An error occurred while modifying the struts configuration file path.
When integrating spring and struts today, place the struts2 configuration file in src/config/struts. xml. An error is always reported when you start the project! The following is the configuration of the struts interceptor on the web:
Struts2
Org. apache. struts2.dispatcher. ng. filter. StrutsPrepareAndExecuteFilter
Config
Config/struts. xml
Struts2
/*
An error always occurs during running, and it takes a whole day. 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)
Maybe it should be unable to struts-default.xml and error!
There are two ways to modify:
Solution 1: Add the following content to struts2.xml:
Solution 2: modify the configuration of the struts interceptor on the web as follows:
Struts2
Org. apache. struts2.dispatcher. ng. filter. StrutsPrepareAndExecuteFilter
Config
Struts-default.xml, config/struts. xml
Struts2
/*