The beginning of the company, to do the project to be more overwhelmed, now one months later, more and more handy, the following is JSON to the front-end value and front-end Ajax to receive, to write down also share to everyone.
This is two different types of JSON interacting with Ajax data (collections, class objects)
Jsonconfig jsonconfig = new Jsonconfig (); Lenient
jsonconfig.setcycledetectionstrategy (cycledetectionstrategy.lenient);
Jsonarray json = Jsonarray.fromobject (LISTPM, jsonconfig);
Outjsondata (JSON);
Blog b= (blog) bgdao.findblog (Integer.parseint (ID));
B.setbbscenterstr (New String (B.getbbscenter ()));
Jsonarray json = Jsonarray.fromobject (b);
Outjsondata (JSON);
Ajax Receive:
DataType: "JSON",
success:function (data) {
var crmhtmlg = ';
$.each (Data,function (i,comment) {
crmhtmlg+= ' <tr> '
+ ' <td colspan= ' 2 "style=" text-align:center; Color:black;font-size:18px;font-weight:bold; " > ' +comment.bbstitle+ ' </td> '
+ ' </tr> '
});
$ (' #bowenchakan '). HTML (CRMHTMLG);
Above this JSON pass value and the Ajax receive the detailed explanation is small arranges to share to everybody's content, hoped can give everybody a reference, also hoped that everybody supports the cloud habitat community.