fastJson将json数组转list对象

import com.alibaba.fastjson.JSONObject;

  public BaseJsonRst execute(
    	@Param(name="id",defaultValue="") Long id,
    	@Param(name="jasonArray",defaultValue="") String jasonArray,
        TurbineRunData rundata, Context context) {
			
		List list = new ArrayList();
		list = JSONObject.parseArray(jasonArray, Person.class);
			
}



ActivityInstanceMessageApp.prototype.submitForm=function(uploadJson){
    var uploadStr,
        that=this;

    $("input[type='text']").each(function(index,item){
        uploadJson[index]=$.extend(uploadJson[index],{
            messageValue:$(item).val(),
            id:$(item).data("id"),
            nodeId:$(item).data("node-id"),
            subNodeId:$(item).data("sub-node-id") || -1,
            messageCode:$(item).data("message-code"),
            insId:$(item).data("ins-id") || -1
        });
    });

    uploadStr=JSON.stringify(uploadJson);

    that.doAjax({
        url:"/operation/json/****Add.json",
        uploadData:{
            activityId:that.activityId,
            jasonArray:uploadStr,
            flowProcessId:that.flowProcessId
        },
        success:function(){
            $("#btnSave").button('reset');
            window.location.reload();
        },
        fail:function(){
            $("#btnSave").button('reset');
        }
    });
}


jsonArray里是前台传的json数组,可以它转成List对象。


fastjson-1.2.5下载地址:http://download.csdn.net/detail/paincupid/9372919

转载请注明出处:http://blog.csdn.net/paincupid/article/details/51221391

你可能感兴趣的:(js,Json,json数组转list对象,jsonArray,List)