我在我們的RESTful服務下面使用此代碼:(輸出的類型是JSON)如何在Restful服務中獲取字段名稱值?
productList = new String[posList.size()][2];
for (int i = 0; i < posList.size(); i++) {
productList[i][0] =(posList.get(i).getUnitprice());
productList[i][1] = (posList.get(i).getCategories().getCategoryName());
}
的結果是這樣的:
"item" : [
"85000",
"modem",
]
我想字段名是價值 之前我是怎麼可以做到這一點?
這個問題還不清楚。 JSON究竟應該是什麼樣子? – wavemode 2015-04-05 09:38:50