您的位置:首页 > 移动开发

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

2011-10-10 15:46 821 查看
错误描述:

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的配置文件不了解
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐