码迷,mamicode.com
首页 > 编程语言 > 详细

json字符串转json对象,json对象转换成java对象

时间:2017-05-12 13:42:24      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:response   java对象   https   获取   字符   get   ons   pre   tps   



@RequestMapping(value = "updateInvestorApplyAccountNo", method = RequestMethod.POST)
@ResponseBody
public void updateInvestorApplyAccountNo(HttpServletRequest request,
HttpServletResponse response,
@RequestBody String requestBody) {
int num = 0;
String result = "";
//下面是把拿到的json字符串转成 json对象
JSONObject jsStr = JSONObject.parseObject(requestBody); //将字符串{“id”:1}
//int jsID = Integer.parseInt(jsStr.getString("id"));//获取id的值


/** 
* json对象转换成java对象 
*/ 
InvestorApplyModel stud = (InvestorApplyModel) JSONObject.toJavaObject(jsStr,InvestorApplyModel.class);

}

 

json字符串转json对象,json对象转换成java对象

标签:response   java对象   https   获取   字符   get   ons   pre   tps   

原文地址:http://www.cnblogs.com/thiaoqueen/p/6844766.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!