In last tutorial we discussed , how to create JSONArray of JSONObjects and pass with Ajax call in JSP.If you want to refer then visit this link:
http://www.jkstack.com/2013/08/how-to-create-json-array-object-with.html
Today,i am going to discussed, how to parse a JSONArray of JSONObjects in JAVA class.
Here is the code:
package com.actions;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import net.sf.json.JSONSerializer;
public class ParseJsonArray {
public void saveValues()
{
try{
String paramJsonValuesString=request.getParameter("paramJsonValues");
JSONObject paramJsonValuesStringJSON=(JSONObject)JSONSerializer.toJSON(paramJsonValuesString);
JSONArray paramPropertyArray=paramJsonValuesStringJSON.getJSONArray("paramProperty");
for(int i=0; i < paramPropertyArray.size(); i++)
{
JSONObject jsonObject=paramPropertyArray.getJSONObject(i);
String Id = jsonObject.getString("Id");
String name = jsonObject.getString("name");
String age = jsonObject.getString("age");
}
}catch(Exception ex){
ex.printStackTrace();
}
}
}
You created some good points presently there. I looked on the web for the problem and discovered most people will accompany with your site.
ReplyDeletewell explained .Keep sharing UI online course Bangalore
ReplyDeleteperde modelleri
ReplyDeletesms onay
mobil ödeme bozdurma
nft nasıl alınır
ankara evden eve nakliyat
trafik sigortası
dedektör
web sitesi kurma
Aşk Romanları
Smm Panel
ReplyDeletesmm panel
iş ilanları
İNSTAGRAM TAKİPÇİ SATIN AL
hirdavatciburada.com
beyazesyateknikservisi.com.tr
Servis
Tiktok Jeton Hilesi İndir
ümraniye mitsubishi klima servisi
ReplyDeletependik mitsubishi klima servisi
tuzla vestel klima servisi
beykoz vestel klima servisi
üsküdar vestel klima servisi
beykoz bosch klima servisi
üsküdar bosch klima servisi
beykoz arçelik klima servisi
üsküdar arçelik klima servisi