• springmvc使用jQuery.datatable时遇到的错误


    springmvc使用jQuery.datatable时遇到的错误

     1 1正确时返回 josn结果:
     2 
     3 {"aaData":[{"age":31,"id":100000,"name":"wwecs","sex":"man"},{"age":1,"id":100001,"name":"second","sex":"man"},{"age":2,"id":100002,"name":"secondone","sex":"man"},{"age":3,"id":100003,"name":"thridone","sex":"man"},{"age":3,"id":100004,"name":"eeeeee","sex":"man"},{"age":32,"id":100005,"name":"t80aaa","sex":"man"},{"age":100,"id":100006,"name":"test0001","sex":"man"}],"iTotalDisplayRecords":10,"iTotalRecords":10,"sEcho":"1"}
     4 
     5 
     6 2  页面显示处理中(processing),列表空白,其实有返回数据,josn结果:
     7 {"aaData":[{"age":31,"id":100000,"name":"wwecs","sex":"man"},{"age":1,"id":100001,"name":"second","sex":"man"},{"age":2,"id":100002,"name":"secondone","sex":"man"},{"age":3,"id":100003,"name":"thridone","sex":"man"},{"age":3,"id":100004,"name":"eeeeee","sex":"man"},{"age":32,"id":100005,"name":"t80aaa","sex":"man"},{"age":100,"id":100006,"name":"test0001","sex":"man"}],"iTotalDisplayRecords":10,"iTotalRecords":10,"sEcho":"1"}
     8 
     9 3 同上一致 
    10 {"aaData":"[{"age":31,"id":100000,"name":"wwecs","sex":"man"},{"age":1,"id":100001,"name":"second","sex":"man"},{"age":2,"id":100002,"name":"secondone","sex":"man"},{"age":3,"id":100003,"name":"thridone","sex":"man"},{"age":3,"id":100004,"name":"eeeeee","sex":"man"},{"age":32,"id":100005,"name":"t80aaa","sex":"man"},{"age":100,"id":100006,"name":"test0001","sex":"man"}]","iTotalDisplayRecords":10,"iTotalRecords":10,"sEcho":"1"}
    11 
    12 
    13 A1  提示“ DataTables warning (table id = 'example1'): Cannot reinitialise DataTable. To retrieve the DataTables object for this table, pass no arguments or...” 时
    14 A2  或者提示“  DataTables warning(table id='example1'):Requested unknown parameter '1' from the data source for row 015 
    16 时返回的json结果:
    17 
    18 {"aaData":"[{"age":31,"id":100000,"name":"wwecs","sex":"man"},{"age":1,"id":100001,"name":"second","sex":"man"},{"age":2,"id":100002,"name":"secondone","sex":"man"},{"age":3,"id":100003,"name":"thridone","sex":"man"},{"age":3,"id":100004,"name":"eeeeee","sex":"man"},{"age":32,"id":100005,"name":"t80aaa","sex":"man"},{"age":100,"id":100006,"name":"test0001","sex":"man"}]","iTotalDisplayRecords":10,"iTotalRecords":10,"sEcho":"1"}
    19 
    20  

    附加去掉   “”  和“[” "]"的方法:

    1             returnstr=returnstr.replaceAll("\\", "");
    2             returnstr = returnstr.replace(Matcher.quoteReplacement("]""), "]");
    3             returnstr = returnstr.replace(Matcher.quoteReplacement(""["), "[");

    若转载请标注  :转自 博客园 : http://www.cnblogs.com/rojas/p/4005045.html

  • 相关阅读:
    我是如何学习和工作的(1)
    SQL server事物复制报错:要复制的 LOB 数据的长度(xxxxx)超出了配置的最大值 65536
    SQL Server2012高可用之事物复制(发布订阅)测试
    MySQL参数学习(一)
    Oracle间隔(interval)分区
    oracle异机恢复测试
    使用awrsqrpt.sql查看执行计划demo
    使用10046追踪执行计划demo
    js中call、apply和bind到底有什么区别?
    为什么0.1+0.2=0.30000000000000004
  • 原文地址:https://www.cnblogs.com/rojas/p/4005045.html
Copyright © 2020-2023  润新知