Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by jacks on Feb 03, 2009 04:20
open dhtmlx forum
how to create json object in jsp in the following format please help me



how to create json object in jsp in the following format please help me

rows:[
{ id:1001,
data:[
"100",
"A Time to Kill",
"John Grisham",
"12.99",
"1",
"05/01/1998"] },
{ id:1002,
data:[
"1000",
"Blood and Smoke",
"Stephen King",
"0",
"1",
"01/01/2000"] }
]}
Answer posted by Support on Feb 03, 2009 05:05
The only requirement for your jsp code  - output data in defined format, you need not to create any special object , just print it as text to stdout ( so it will be fetched by client side component while data accessing ) 
You may look at json-taglib, which is not required in common case, but may help 
http://json-taglib.sourceforge.net/tutorial.html