ajax传参数json对象到后台获取

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_37279783/article/details/80910008
var data = {data:{name:'pxxx',
                    paramData:[{dataSource:'a1',table:'t1',field:'f1','r':[{name1:"01",p:''},{name2:"02",p:'10,100'},{name2:"01",p:''}]},
                        {dataSource:'a2',table:'t2',field:'f2','r':[{name1:"01",p:''},{name2:"02",p:'10,100'},{name3:"01",p:''}]}]
                }};
$.ajax({
    type:"POST",
    async:false,
    dataType:'json',
    contentType : "application/json",
    url:"matePxxx/addPxx",
    data: JSON.stringify(data),
    success:function (data) {

            }
});

@RequestMapping("/addPxx")
@ResponseBody
public Map<String,Boolean> addPxxx(@RequestBody JSONObject data){
   System.out.println(data);
  return map;
}
$.ajax({
                                                type:"post",
                                                dataType:"json",
                                                url:"DataSourceCheck/refreshDataSource",
                                                data:{dataSourceId:dsId},
                                                success: function(data){
                                                    
                                                }
                                            });

@RequestMapping("refreshDataSource")
    @ResponseBody
    public boolean refreshDataAction(String dataSourceId){
        return true;
    }

猜你喜欢

转载自blog.csdn.net/qq_37279783/article/details/80910008
今日推荐