json+;struts2如何仅解析datatab详细信息
我有以下json响应。如何解析数据表内容json+;struts2如何仅解析datatab详细信息,json,struts2,Json,Struts2,我有以下json响应。如何解析数据表内容 { "activeEnergy": null, "activeEnergyVal": null, "apparentEnergy": null, "apparentEnergyVal": null, "bCurrent": null, "bCurrentVal": null, "bLoadval": null, "bVoltage": null, "bVoltageval": nul
{
"activeEnergy": null,
"activeEnergyVal": null,
"apparentEnergy": null,
"apparentEnergyVal": null,
"bCurrent": null,
"bCurrentVal": null,
"bLoadval": null,
"bVoltage": null,
"bVoltageval": null,
"bload": null,
"datatab": {
"columnDescriptions": [
{
"customProperties": {},
"id": "Date",
"label": "Date",
"pattern": "",
"type": "TEXT"
},
{
"customProperties": {},
"id": "Month",
"label": "Month",
"pattern": "",
"type": "TEXT"
},
{
"customProperties": {},
"id": "ApparentEnergy_KvAh",
"label": "ApparentEnergy_KvAh",
"pattern": "",
"type": "NUMBER"
},
{
"customProperties": {},
"id": "Rload",
"label": "Rload",
"pattern": "",
"type": "NUMBER"
},
{
"customProperties": {},
"id": "Yload",
"label": "Yload",
"pattern": "",
"type": "NUMBER"
},
{
"customProperties": {},
"id": "Bload",
"label": "Bload",
"pattern": "",
"type": "NUMBER"
}
],
"customProperties": {},
"localeForUserMessages": null,
"numberOfColumns": 18,
"numberOfRows": 6,
"rows": [
{
"cells": [
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "TEXT",
"value": {
"null": false,
"objectToFormat": "02",
"type": "TEXT",
"value": "02"
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "TEXT",
"value": {
"null": false,
"objectToFormat": "00",
"type": "TEXT",
"value": "00"
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 11,
"type": "NUMBER",
"value": 11
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 10,
"type": "NUMBER",
"value": 10
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 1057,
"type": "NUMBER",
"value": 1057
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 0,
"type": "NUMBER",
"value": 0
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 1788,
"type": "NUMBER",
"value": 1788
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 1233,
"type": "NUMBER",
"value": 1233
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 1202,
"type": "NUMBER",
"value": 1202
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 1208,
"type": "NUMBER",
"value": 1208
}
}
],
"customProperties": {}
},
{
"cells": [
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "TEXT",
"value": {
"null": false,
"objectToFormat": "05",
"type": "TEXT",
"value": "05"
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "TEXT",
"value": {
"null": false,
"objectToFormat": "08",
"type": "TEXT",
"value": "08"
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "TEXT",
"value": {
"null": false,
"objectToFormat": "2014",
"type": "TEXT",
"value": "2014"
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "TEXT",
"value": {
"null": false,
"objectToFormat": "23",
"type": "TEXT",
"value": "23"
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "TEXT",
"value": {
"null": false,
"objectToFormat": "00",
"type": "TEXT",
"value": "00"
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 11,
"type": "NUMBER",
"value": 11
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 11,
"type": "NUMBER",
"value": 11
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 11,
"type": "NUMBER",
"value": 11
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 253,
"type": "NUMBER",
"value": 253
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 254,
"type": "NUMBER",
"value": 254
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 255,
"type": "NUMBER",
"value": 255
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 3463,
"type": "NUMBER",
"value": 3463
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 2558,
"type": "NUMBER",
"value": 2558
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 0,
"type": "NUMBER",
"value": 0
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 4331,
"type": "NUMBER",
"value": 4331
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 2962,
"type": "NUMBER",
"value": 2962
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 2806,
"type": "NUMBER",
"value": 2806
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 2849,
"type": "NUMBER",
"value": 2849
}
}
],
"customProperties": {}
},
{
"cells": [
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "TEXT",
"value": {
"null": false,
"objectToFormat": "07",
"type": "TEXT",
"value": "07"
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "TEXT",
"value": {
"null": false,
"objectToFormat": "08",
"type": "TEXT",
"value": "08"
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "TEXT",
"value": {
"null": false,
"objectToFormat": "2014",
"type": "TEXT",
"value": "2014"
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "TEXT",
"value": {
"null": false,
"objectToFormat": "00",
"type": "TEXT",
"value": "00"
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "TEXT",
"value": {
"null": false,
"objectToFormat": "00",
"type": "TEXT",
"value": "00"
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 0,
"type": "NUMBER",
"value": 0
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 0,
"type": "NUMBER",
"value": 0
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 0,
"type": "NUMBER",
"value": 0
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 254,
"type": "NUMBER",
"value": 254
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 255,
"type": "NUMBER",
"value": 255
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 256,
"type": "NUMBER",
"value": 256
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 20,
"type": "NUMBER",
"value": 20
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 30,
"type": "NUMBER",
"value": 30
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 0,
"type": "NUMBER",
"value": 0
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 40,
"type": "NUMBER",
"value": 40
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 76,
"type": "NUMBER",
"value": 76
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 0,
"type": "NUMBER",
"value": 0
}
},
{
"customProperties": {},
"formattedValue": null,
"null": false,
"type": "NUMBER",
"value": {
"null": false,
"objectToFormat": 0,
"type": "NUMBER",
"value": 0
}
}
],
"customProperties": {}
}
],
"warnings": []
},
}
用ajax试试这个,给我更多的信息,告诉我你到底想做什么
success : function(response){
for(var i=0;i<response.datatab.columnDescriptions.length;i++){
alert(response.datatab.columnDescriptions[i].id);
alert(response.datatab.columnDescriptions[i].label);
}
}
成功:功能(响应){
对于(var i=0;ii)我希望获取数据表详细信息以显示图形。我希望获取数据表详细信息以使用google visualization显示图形。plz如何帮助我。您希望在服务器端或客户端解析哪里?请提供您面临问题的更多信息?