天天看点

myeclipse 配置struts出现 Unable to load configuration.

:: [localhost-startStop-] ERROR org.apache.struts2.dispatcher.Dispatcher - Dispatcher initialization failed
com.opensymphony.xwork2.config.ConfigurationException: Unable to load 
           
Unable to load configuration. - action - file:/D:/myeclipse/apache-tomcat-.M15/webapps/struts2Moudle/WEB-INF/classes/struts.xml::
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:)
           
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
    "http://struts.apache.org/dtds/struts-2.3.dtd">

<struts>
    <constant name="struts.devMode" value="true"></constant>
    <package name="p1">

        <action name="action1">
            <result name="success">index.jsp</result>
        </action>
    </package>
</struts>
           

工具提示我不能加载这个配置,仔细检查我的struts.xml 发现,我并没有为 包名为p1 的包,指定extends属性。。。。。。写上extends=”struts-default” 问题解决!