myeclipse 配置struts出现 Unable to load configuration.

本文介绍了一个关于Struts2框架配置文件(struts.xml)中出现的错误:未指定包的extends属性导致初始化失败的问题。通过添加extends属性,成功解决了异常。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

17:32:06.818 [localhost-startStop-1] 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-9.0.0.M15/webapps/struts2Moudle/WEB-INF/classes/struts.xml:10:26
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:504)
<?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” 问题解决!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值