Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用返回Spring MVC+;休眠RESTfulWeb服务?_Java_Jquery_Json_Spring_Spring Mvc - Fatal编程技术网

Java 如何使用返回Spring MVC+;休眠RESTfulWeb服务?

Java 如何使用返回Spring MVC+;休眠RESTfulWeb服务?,java,jquery,json,spring,spring-mvc,Java,Jquery,Json,Spring,Spring Mvc,我想用SpringMVC返回的JSON对象填充JQuery表。 我的JSON数据格式是 { availDate: 1421508979000 custName: "Navin" custMobile: "8765432468" custEmail: "abc@gmail.com" custAddress: "BAngalore" } 我获取数据的服务url为 但是我的代码不起作用,请检查一下 <!DOCTYPE html> <html> <

我想用SpringMVC返回的JSON对象填充JQuery表。 我的JSON数据格式是

{
availDate: 1421508979000
custName: "Navin"
custMobile: "8765432468"
custEmail: "abc@gmail.com"
custAddress: "BAngalore"
}
我获取数据的服务url为 但是我的代码不起作用,请检查一下

<!DOCTYPE html>
    <html>
        <head>
            <script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>     
            <script src="http://cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js"> </script>       
            <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css">
             <script>
              $(document).ready(function() {
              $('#example').dataTable( {
                "bProcessing": true,
                "bServerSide": true,
                "sAjaxSource": "http://localhost:8080/HomeServiceProvider/booking/getAllBookingDetails" // for you it will be - /getWidgetsByType
              } );
            } );
            </script>       
        </head>
    <body>
        <table id="example" class="display" cellspacing="0" width="100%">
            <thead>
                <tr>
                    <th>availDate</th>
                    <th>custName</th>
                    <th>Office</th>
                    <th>custMobile</th>
                    <th>custAddress</th>
                </tr>
            </thead>
        </table>
    </body>
    </html>

$(文档).ready(函数(){
$('#示例')。数据表({
“bProcessing”:正确,
“bServerSide”:正确,
“sAjaxSource”:http://localhost:8080/HomeServiceProvider/booking/getAllBookingDetails“//对于您来说,它将是-/getWidgetsByType
} );
} );
有效
客户名称
办公室
卡斯特莫比尔
客户地址

在数据表中添加列名及其各自的数据(JSON键值):

"columns" : [ {
    "mData" : "availDate",
    "bSortable" : true
}, {
    "mData" : "custName",
    "bSortable" : true
}, {
    "mData" : "custMobile",
    "bSortable" : true
}, {
    "mData" : "custEmail",
    "bSortable" : true
}, {
    "mData" : "custAddress",
    "bVisible" : false
}]
检查列的用法