六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 31|回复: 0

json JSONArray.fromObject()不执行

[复制链接]

升级  40%

4

主题

4

主题

4

主题

童生

Rank: 1

积分
20
 楼主| 发表于 2013-1-29 10:33:02 | 显示全部楼层 |阅读模式
在用json+struts2+jquery 实现ajax时遇到了如下问题:
   JSONArray obj = JSONArray.fromObject(allTypeList);
上面的这句话这么也不执行.
我用的是 json-lib-2.1-jdk1.5、struts2-json-plugin-2.3.1.2.
我以为是json-lib版本的问题,就接连换了几个版本,结果还是木有反应阿。。。
后来想到可以看看他的帮助文档时怎么写的,于是上了json的官网。。。

compile
The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

GroupId              ArtifactId/Version/Classifier/Type/Optional
commons-beanutils    commons-beanutils /1.8.0/-/jar  
commons-collections  commons-collections/3.2.1/-/jar  
net.sf.ezmorph       ezmorph/1.0.6/-/jar  
org.codehaus.groovy  groovy-all 1.7.5 -/jar (optional)
oro                  oro/2.0.8/-/jar (optional)
xom                  xom/1.1/-/jar (optional)
----------------------------------
原来需要上面的包(最后三个可选).
加入以上包就Ok.
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表