Tried to assign property OutStationNo:java.lang.Integer to bean of class

来源:互联网 发布:四川校校通网络平台 编辑:程序博客网 时间:2024/06/10 03:20
net.sf.json.JSONObject net.sf.json.JSONObject.toBean(JSONObject.java:431) - Tried to assign property OutStationNo:java.lang.Integer to bean of class com.newsoft.roadService.po.FeeVOnet.sf.json.JSONObject net.sf.json.JSONObject.toBean(JSONObject.java:431) - Tried to assign property VehClassNo:java.lang.Integer to bean of class com.newsoft.roadService.po.FeeVOnet.sf.json.JSONObject net.sf.json.JSONObject.toBean(JSONObject.java:431) - Tried to assign property WayTypeNo:java.lang.Integer to bean of class com.newsoft.roadService.po.FeeVO

今天偶然在调试程序的时候,偶然发现这个警告,同时还发现当json转换为bean对象时,发现上述报警告的这些值在对象中全部为空。
看了源码也找不到问题所在,后面发现与该对象中其他值唯一不同的地方就是开头字母大写了。(接口文档中规定第一个字母大写,故出现此种情况)

这里写图片描述

解决方案:
在研究该问题时,发现有两种解决方案
1、将该bean对象的首字母全部改为小写。
这里写图片描述
2、将该bean对象的首字母大写的后面几个单词改为大写(开头算起,连续的大写字母数量>1)
这里写图片描述

阅读全文
0 0
原创粉丝点击