There is no result type defined for type 'json' mapped with name 'success'.

本文介绍了解决Struts2使用Ajax时遇到的JSON配置问题。通过调整struts.xml文件中的extends属性值,从struts-default改为json-default,可以成功避免出现关于JSON类型定义错误。

There is no result type defined for type 'json' mapped with name 'success'.  

2012-10-10 15:25:12|  分类: 学习笔记 |  标签:json  json错误  result  type=  ajax和struts2  |举报|字号 订阅

在struts2使用ajax时,配置result时需要配置其type为json。当添加了json-lib-2.3-jdk15.jar和struts2-json-plugin-2.3.4.1.jar两个包时,仍然还会报错:There is no result type defined for type 'json' mapped with name 'success'.在网上查了很多资料,说少了其他什么包,但试了都没用,主要可能struts版本不同。这里其实是需要修改struts.xml中的<package中的 extends="struts-default"为 extends="json-default"即可解决此错误。

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值