json JSONArray.fromObject()不执行

来源:互联网 发布:淘宝客api调用实例php 编辑:程序博客网 时间:2024/04/30 05:00
在用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.
原创粉丝点击