@ResponseBody returns null object ajax callback unsuccessful


The return processing of @ResponseBody can be handled by a class that inherits ObjectMapper. For
example , filtering special characters, processing null (property, not object), and returning null object (if datetyp: "json" is set for ajax pair, it will not be called back In success, it will be called back in error), you can wrap json, {result: "true", data: ""} is guaranteed to be json, or go to datatype: "json", and then process the time format. That is to

say Ajax's callback success or error not only depends on the return status, but also whether the returned request is also requested

$.ajax({
        type: "post",
        url: "${applicationScope.contextPath}/tbConFirmFee/getCustomer",
        data: dataParent,
       /// dataType: "json",
        success: function (data) {
        allPrpos(data);
        alert("====callback=====");
        alert("====callback=== =="+ data);
        allPrpos(data);
        alert("====Callback=====");
        alert("====callback r====="+ data);
        allPrpos(data);
        alert("====回调=====");
        },
        error:function(data){
        var a=data;
        allPrpos(a);
        alert("====回调error111====="+ data);
        alert("====回调error11====="+data);
        allPrpos(data);
       
        }
    });




===

@RequestMapping("/tbConFirmFee/getCustomer")
public @ResponseBody  TbCusFirm  getCustomer(@RequestParam(value = "customerid", required = false) String customerid, Model model) throws EsteelException {
TbCusFirm use = new TbCusFirm();
if(!"".equals(customerid)&&null!=customerid){
use.setCustomerKey(BigDecimal.valueOf(Long.valueOf(customerid)));
use= tbConFirmFeeService.getCustomerInfo(use);
}
return use;
}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326606986&siteId=291194637