nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct in

 

在用ajax提交表单数据时,我们常需要将form表单数据转为JSON格式,但是form表单序列化仅加上加上JSON.stringify()还不够,需要将form序列化用函数转换如:

function getFormData($form){
    var unindexed_array = $form.serializeArray();
    var indexed_array = {};

    $.map(unindexed_array, function(n, i){
        indexed_array[n['name']] = n['value'];
    });

    return indexed_array;
}

 转载自:https://stackoverflow.com/questions/11338774/serialize-form-data-to-json

你可能感兴趣的:(nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct in)