NutzCN Logo
问答 @AdaptBy(type=JsonAdaptor.class)使用问题
发布于 2116天前 作者 码农 2712 次浏览 复制 上一个帖子 下一个帖子
标签:

使用JsonAdaptor的时候,报了个错

[{"name":"categoryId","value":"10011"},{"name":"name","value":"测试"},{"name":"address","value":"深圳市"},{"name":"lng","value":"114.41762924194337"},{"name":"lat","value":"22.634569963557734"},{"name":"datatype","value":"1"}]
        var sdoData= JSON.stringify($("#addSdoForm").serializeArray());
        $.ajax({
            type: "post",
            contentType: "application/json;charset=UTF-8",
            dataType:"json",
            url: "${base!}/platform/sys/xxxx/xxx",
            data: {"sdoData":sdoData},
            success: function (data) {
                console.log(data);
            },
            error: function (data) {

            }
        });
 @At("/addDo")
    @Ok("json")
    @POST
    @RequiresAuthentication
    @AdaptBy(type=JsonAdaptor.class)
    public Object addSysData(ArrayList<HashMap<String,String>> sdoData){

报错如下

org.nutz.json.JsonException: !Json syntax error nearby [row:1,col:1 char 's'], reason: 'Unexpect String = sdoData=%5B%7B%22name%22%3A%22categoryId%22%2C%22value%22%3A%2210011%22%7D%2C%7B%22name%22%3A%22name%22%2C%22value%22%3A%22%E6%B5%8B%E8%AF%95%22%7D%2C%7B%22name%22%3A%22address%22%2C%22value%22%3A%22%E6%B7%B1%E5%9C%B3%E5%B8%82%22%7D%2C%7B%22name%22%3A%22lng%22%2C%22value%22%3A%22114.41762924194337%22%7D%2C%7B%22name%22%3A%22lat%22%2C%22value%22%3A%2222.634569963557734%22%7D%2C%7B%22name%22%3A%22datatype%22%2C%22value%22%3A%221%22%7D%5D&attrData=%5B%7B%22name%22%3A%22item1%22%2C%22value%22%3A%22%E6%B5%8B%E8%AF%95%E6%95%B0%E6%8D%AE%22%7D%2C%7B%22name%22%3A%22item2%22%2C%22value%22%3A%22%E6%B7%B1%E5%9C%B3%E5%B8%82%E5%A4%A7%E9%B9%8F%E6%96%B0%E5%8C%BA%22%7D%2C%7B%22name%22%3A%22item3%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item4%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item5%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item6%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item7%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item8%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item9%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item10%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item11%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item12%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item13%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item14%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item15%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item16%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item17%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item18%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item19%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item20%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item21%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item22%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item23%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item24%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item25%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item26%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item27%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item28%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item29%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item30%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item31%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item32%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item33%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item34%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item35%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item36%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item37%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item38%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item39%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item40%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item41%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item42%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item43%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item44%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item45%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item46%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item47%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item48%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item49%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item50%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item51%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item52%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item53%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item54%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item55%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item56%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item57%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item58%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item59%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item60%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item61%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item62%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item63%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item64%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item65%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item66%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item67%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item68%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item69%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item70%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item71%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item72%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item73%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item74%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item75%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item76%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item77%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item78%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item79%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item80%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item81%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item82%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item83%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item84%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item85%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item86%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item87%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item88%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item89%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item90%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item91%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item92%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item93%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item94%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item95%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item96%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item97%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item98%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item99%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item100%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item101%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item102%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item103%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item104%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item105%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item106%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item107%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item108%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item109%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item110%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item111%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item112%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item113%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item114%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item115%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item116%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item117%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item118%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item119%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item120%22%2C%22value%22%3A%22%22%7D%5D&modelData=%5B%7B%22name%22%3A%22item1%22%2C%22value%22%3A%22%E5%90%8D%E7%A7%B0%22%7D%2C%7B%22name%22%3A%22item2%22%2C%22value%22%3A%22%E5%9C%B0%E5%9D%80%22%7D%2C%7B%22name%22%3A%22item3%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item4%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item5%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item6%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item7%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item8%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item9%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item10%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item11%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item12%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item13%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item14%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item15%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item16%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item17%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item18%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item19%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item20%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item21%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item22%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item23%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item24%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item25%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item26%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item27%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item28%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item29%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item30%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item31%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item32%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item33%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item34%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item35%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item36%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item37%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item38%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item39%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item40%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item41%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item42%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item43%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item44%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item45%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item46%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item47%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item48%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item49%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item50%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item51%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item52%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item53%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item54%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item55%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item56%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item57%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item58%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item59%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item60%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item61%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item62%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item63%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item64%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item65%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item66%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item67%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item68%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item69%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item70%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item71%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item72%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item73%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item74%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item75%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item76%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item77%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item78%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item79%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item80%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item81%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item82%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item83%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item84%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item85%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item86%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item87%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item88%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item89%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item90%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item91%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item92%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item93%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item94%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item95%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item96%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item97%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item98%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item99%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item100%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item101%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item102%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item103%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item104%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item105%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item106%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item107%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item108%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item109%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item110%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item111%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item112%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item113%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item114%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item115%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item116%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item117%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item118%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item119%22%2C%22value%22%3A%22%22%7D%2C%7B%22name%22%3A%22item120%22%2C%22value%22%3A%22%22%7D%5D'
3 回复

文档有实例

data: sdoData,

你现在写的是当表单参数发json,不死才怪

像这样需要传多个json怎么弄?

 data: {"sdoData":sdoData,"attrData":attrData,"modelData":modelData},

没有多个json一说的,要放在一个json里面发,没人会像你这样发的

添加回复
请先登陆
回到顶部