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的配置文件不了解

你可能感兴趣的:(json,struts,Class,扩展,action,performance)