引用的json_lib包
1、如何将两个javabean(继承关系 course 和 teacher)转换为如下格式:
{
"course":{"字段1":"值1","字段2":"值2"....,"字段N":"值N"},
"teacher":["字段1":"值1","字段2":"值2"....,"字段N":"值N"]
}
2、json转换为javabean
json中包含有“时间”字段,javabean中对应的属性是Timestamp类型,调用JSONArry.fromObject(json字符串),会报错,这个时间字段json转换成了String,而javabean是Timestamp类型
JSON JaveBean J2EE
------解决方案--------------------
http://xinyangwjb.iteye.com/blog/1450586
定义过滤器
------解决方案--------------------
"teacher":["字段1":"值1","字段2":"值2"....,"字段N":"值N"],你这个teacher是什么情况是数组吗?什么继承关系course和teacher能说清楚点吗