日期:2014-05-16  浏览次数:20311 次

SSH+JSON时遇到的问题
问题描述
org.apache.struts2.json.JSONException: org.apache.struts2.json.JSONException: org.apache.struts2.json.JSONException: org.apache.struts2.json.JSONException: java.lang.IllegalAccessException: Class org.apache.struts2.json.JSONWriter can not access a member of class org.springframework.aop.interceptor.ExposeInvocationInterceptor$1 with modifiers "public"
在网上搜索了很多关于这个问题的解决方式
基本上分为2类
1个是在相应的get方法上面加上注解
例如:
@JSON(name='名称')
2个就是去掉注入service的get 方法
此处去掉get方法时需要注意,可能这个get方法并不是你目前使用的这个变量的get方法,有可能是其他变量的get方法所影响,因此删除的时候需要注意你删除的这个变量是否在其他地方使用到过。
1 楼 xuchengfeifei 昨天  
直接在get方法上面加一个@JSON(serialize=false)就行了、不用去掉