【ssh学习笔记】struts处理json异常之JSONWriter can not access a member of class org.springframework.aop.TruePoin
来源:互联网 发布:查询淘宝页面历史快照 编辑:程序博客网 时间:2024/06/05 13:30
Struts has detected an unhandled exception:
Messages:
- Class org.apache.struts2.json.JSONWriter can not access a member of class org.springframework.aop.TruePointcut with modifiers "public"
- java.lang.IllegalAccessException: Class org.apache.struts2.json.JSONWriter can not access a member of class org.springframework.aop.TruePointcut with modifiers "public"
- org.apache.struts2.json.JSONException: java.lang.IllegalAccessException: Class org.apache.struts2.json.JSONWriter can not access a member of class org.springframework.aop.TruePointcut with modifiers "public"
- 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.TruePointcut with modifiers "public"
- 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.TruePointcut with modifiers "public"
该类中UserManager不需要添加到json中,但是被添加了,造成了异常,解决方法,在getXXX()上面添加@JSON(serialize=false)
public class JsonAction extends ActionSupport {/** * */private static final long serialVersionUID = -9040282050464969108L;private String isSuccess = "success";private List<Map<String, Object>> users = new ArrayList<Map<String, Object>>();private UserManager userManager;@JSON(name="result")public String getIsSuccess() {return isSuccess;}public void setIsSuccess(String isSuccess) {this.isSuccess = isSuccess;}public List<Map<String, Object>> getUsers() {return users;}public void setUsers(List<Map<String, Object>> users) {this.users = users;}
<span style="white-space:pre">@JSON(serialize=false)</span>public UserManager getUserManager() {return userManager;}public void setUserManager(UserManager userManager) {this.userManager = userManager;}@Overridepublic String execute() throws Exception {List<User> userList = userManager.listUsers();for(User user : userList){Map<String, Object> jsonMap = new HashMap<String, Object>();jsonMap.put("id", user.getId());jsonMap.put("username", user.getUsername());jsonMap.put("password", user.getPassword());users.add(jsonMap);}return SUCCESS;}}
0 0
- 【ssh学习笔记】struts处理json异常之JSONWriter can not access a member of class org.springframework.aop.TruePoin
- Class org.apache.struts2.json.JSONWriter can not access a member of class org.springframework.aop.in
- org.apache.struts2.json.JSONWriter can not access a member of class org.apache.commons.dbcp...
- Class org.apache.struts2.json.JSONWriter can not access a member of class
- Class org.apache.struts2.json.JSONWriter can not access a member of class
- Class org.apache.struts2.json.JSONWriter can not access a member of *(转)
- Class org.apache.struts2.json.JSONWriter can not access a member of *
- Class org.apache.struts2.json.JSONWriter can not access a member of *
- Class org.apache.struts2.json.JSONWriter can not access a member of *
- Class org.apache.struts2.json.JSONWriter can not access a member of *
- org.apache.struts2.json.JSONWriter can not access a member of class
- Class org.apache.struts2.json.JSONWriter can not access a member of *
- Class org.apache.struts2.json.JSONWriter can not access a member of *
- Class org.apache.struts2.json.JSONWriter can not access a member of *
- 遇到问题---org.apache.struts2.json.JSONWriter can not access a member of class
- org.apache.struts2.json.JSONWriter can not access a member of class
- org.apache.struts2.json.JSONWriter can not access a member of class org.apache.commons.dbcp.PoolingD
- Class org.apache.struts2.json.JSONWriter can not access a member of class oracle.jdbc.driver.Physica
- android_rpg 天龙群侠传
- (java)Rectangle Area
- Spring框架(二)--AOP面向切面编程
- 第9周项目3-稀疏矩阵的三元组表示的应用(3.2).cpp
- Making Sequences is Fun(简单枚举)
- 【ssh学习笔记】struts处理json异常之JSONWriter can not access a member of class org.springframework.aop.TruePoin
- 如何优化UITableView性能
- 第9周项目4-广义表算法库(4.1).cpp
- python读写Excel
- C#由指定数据生成灰度位图或者彩色位图
- ios8调用相机报警告: Snapshotting a view that has not been rendered results in an empty snapshot. Ensure yo
- Hbase shell 常用命令
- (java)Contains Duplicate II
- 关于反射中.getDeclaredContructor()返回构造方法顺序的问题