Struts2 错误:There is no result type defined for type 'json' mapped with name 'success'.

错误描述:

Caused by: There is no result type defined for type 'json' mapped with name 'success'.  Did you mean 'json'? - result - file:/D:/Workspaces/MyEclipse%208.5/oam/target/classes/performance.xml:23:25

    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildResults(XmlConfigurationProvider.java:621)

    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:365)

    ... 26 more

   

 

然后查看, performance.xml的是否正确,源码如下

 

<package name="performance" namespace="/performance" extends="struts-default">

    

    <action name="accountpage" class = "com.dice.voip.web.oam.base.BaseAction">

        <result>/performance/systemaccount.jsp</result>

    </action>

    

    

    <action name="accountinfos" class="com.dice.voip.web.oam.actions.SysInfoAccountAction">

        <result type="json"></result>

    </action>

 

</package>

</struts>


 

图中明示的问题为struts-default,因为在struts.xml文件中已经定义了包default,并且在该包中定义了json这一结果,因此package performance的扩展包必须是default,修改后问题解决

 

分析出错原因:

对Struts2的配置文件不了解

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值