struts2 配置错误There is no result type defined for type 'json'
2014-03-03 10:31
676 查看
在struts2的配置中看到 <result type="json"></result>,启动项目后,发现后台直接运行错误,
[com.opensymphony.xwork2.config.providers.XmlConfigurationProvider]2013-05-18 10:17:59,232 [localhost-startStop-1]
[DEBUG] - The result type [org.apache.struts2.json.JSONResult] doesn't have a default param [DEFAULT_PARAM] defined!
[com.opensymphony.xwork2.config.providers.XmlConfigurationProvider]java.lang.NoSuchFieldException: DEFAULT_PARAM
at java.lang.Class.getField(Class.java:1539)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addResultTypes(XmlConfigurationProvider.java:569)
at...
和There is no result type defined for type 'json' ,将struts2-json-plugin-*.jar的版本号又2.1.8升级成2.1.16就ok拉!
<package name="/"
extends="json-default">
<action name="aname" class="relationAction" method="getTeamByCounty">
<result name=“list”
type="json" />
</action>
注意:上面的这个extends ,默认的是继承struts-default,所以这里也需要修改,需要继承json-default。
[com.opensymphony.xwork2.config.providers.XmlConfigurationProvider]2013-05-18 10:17:59,232 [localhost-startStop-1]
[DEBUG] - The result type [org.apache.struts2.json.JSONResult] doesn't have a default param [DEFAULT_PARAM] defined!
[com.opensymphony.xwork2.config.providers.XmlConfigurationProvider]java.lang.NoSuchFieldException: DEFAULT_PARAM
at java.lang.Class.getField(Class.java:1539)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addResultTypes(XmlConfigurationProvider.java:569)
at...
和There is no result type defined for type 'json' ,将struts2-json-plugin-*.jar的版本号又2.1.8升级成2.1.16就ok拉!
<package name="/"
extends="json-default">
<action name="aname" class="relationAction" method="getTeamByCounty">
<result name=“list”
type="json" />
</action>
注意:上面的这个extends ,默认的是继承struts-default,所以这里也需要修改,需要继承json-default。
相关文章推荐
- newtonsoft.json解析天气数据出错解决方法
- ASP JSON类文件的使用方法
- PHP6 先修班 JSON实例代码
- 关于JSON以及JSON在PHP中的应用技巧
- jquery中ajax调用json数据的使用说明
- JQuery 解析多维的Json数据格式
- Ajax与JSON的一些学习总结
- JQuery将文本转化成JSON对象需要注意的问题
- jQuery 中使用JSON的实现代码
- struts2 jquery 打造无限层次的树
- 用JavaScript对JSON进行模式匹配 (Part 2 - 实现)
- 对Java中JSON解析器的一些见解
- ajax交互Struts2的action(客户端/服务器端)
- js实现json数据行到列的转换的实例代码
- jQuery1.4.2与老版本json格式兼容的解决方法
- struts2 spring整合fieldError问题
- Struts2的s:radio标签使用及用jquery添加change事件
- JSON在PHP中的应用介绍
- jquery.pagination +JSON 动态无刷新分页实现代码
- JSON 学习之完全手册 图文