使用:import net.sf.json.JSONObject;
调用JSONObject x = new JSONObject()或者其它构造函数,不报错直接异常。。catch了也不能打印出来,一般是json缺包。
struts2.1.6 json需要包:
1.commons-beanutils-1.7.0.jar
2.commons-collections-3.2.1.jar
3.commons-lang-2.3.jar
4.commons-logging-1.0.4.jar
5.ezmorph-1.0.3.jar
6.json-lib-2.1.jar
其它版本查下必须包就ok
文章详细介绍了在使用Struts2.1.6版本时遇到的JSON解析异常问题,并提供了可能的原因及解决方案。主要内容包括检查并确保必要的依赖库如commons-beanutils、commons-collections等已正确导入,以及如何通过异常捕获进行调试。
610

被折叠的 条评论
为什么被折叠?



