zoukankan      html  css  js  c++  java
  • 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(可选)

  • 相关阅读:
    加深对C#数据类型的认识
    Spring------关于代理
    Java数组
    C#小型资源管理器
    面向对象七大原则
    关于C#换肤IrisSkin
    非泛型集合
    经理评价系统总结
    深入.NET框架
    航班系统总结
  • 原文地址:https://www.cnblogs.com/jhcelue/p/6893407.html
Copyright © 2011-2022 走看看