com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$Mis

为什么会出现这个错误?

我使用了Maven配置Struts,所以修改Struts配置文件的默认路径,如下:

<!-- 配置struts -->
	<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>../../resources/struts.xml</param-value>
		</init-param>
	</filter>

	<filter-mapping>
		<filter-name>struts2</filter-name>
		<url-pattern>*.cgi</url-pattern>
	</filter-mapping>

由于不是默认录了, 一些框架需要的参数无法加载。

解决办法:

修改

<param-value>../../resources/struts.xml</param-value>为
<param-value>struts-default.xml,struts-plugin.xml,../../resources/struts.xml</param-value>
struts-default.xml(必须),struts-plugin.xml(可选)

你可能感兴趣的:(com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$Mis)