具体代码如下:
引用js和css文件有:
代码如下:
script>
script>
script>
script>
页面代码:
代码如下:
$("#userTable").tablePaging();
script>
此处要特别注意的是要讲table的表头加上
标签,且注意此处的table的id为userTable,这个在后面Js文件的引用中十分重要,一句$("#userTable").tablePaging();会去执行jquery.table.js中的代码。
后台action的代码如下:
代码如下:
public ActionForward listUser(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response){
List
pojos = serviceSmUserImpl.findAll();
List smUserList = new ArrayList();
for(POJO pojo:pojos){
smUserList.add((SmUser)pojo);
}
request.setAttribute("userList",smUserList);
return mapping.findForward("smUserList");
}
运用jquery实现表格分页打包