有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何用返回Spring MVC+Hibernate restful web服务的JSON对象填充表?

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

{
availDate: 1421508979000
custName: "Navin"
custMobile: "8765432468"
custEmail: "abc@gmail.com"
custAddress: "BAngalore"
}

我获取数据的服务url是 http://localhost:8080/HomeServiceProvider/booking/getAllBookingDetails 但是我的代码不起作用,请检查一下

<!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>

共 (0) 个答案