springmvc_前后前_接收json数据

页面的ajax的请求json

jQuery.ajax({ 
    type: "POST", 
    url: "/createTopic",
    async : false, 
    data:JSON.stringify({
        "xxx":topic,
        "yyy":topicDesc,
        "aaa":maxRetryTime,
        "bbb":retryInterval,
    }),
    dataType: "json", 
    contentType:"application/json;charset=UTF-8",
    success: function(data){ 
        if(data!=null){ 
            jQuery("[name='topicId']").val(data.topicId);
            jQuery("[name='topicName']").val(data.topicName);
        }else{ 
            alert(data.message); 
        } 
    } 
});

猜你喜欢

转载自blog.csdn.net/maqingbin8888/article/details/82181096