春季MVC分页 [英] Pagination in spring mvc
本文介绍了春季MVC分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的问题是如何在jsp ex中给出页码:如果我在db上的列表大小为30,但我只想在第一页中显示10,如何在jsp中显示1 2 3的数字,30/3,
My question is how to give page number in jsp ex: if I have the list size is 30 on db but I want to display only 10 in page one, how to display 1 2 3 number in jsp , 30 /3,
推荐答案
您可以使用DataTable显示数据:
You can use DataTable for displaying data:
下面显示的Javascript用于初始化此示例中显示的表:
The Javascript shown below is used to initialise the table shown in this example:
$(document).ready(function() {
$('#example').DataTable();
} );
除了上面的代码外,还加载了以下Javascript库文件以供本示例使用:
In addition to the above code, the following Javascript library files are loaded for use in this example:
//code.jquery.com/jquery-1.12.4.js
https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js
https://cdn.datatables.net/1.10.15/js/dataTables.bootstrap.min.js
这篇关于春季MVC分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文