最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Spring MVC下 bootStrap服务器分页代码
时间:2017-06-14 编辑:简简单单 来源:一聚教程网
因为Spring 对于ajax直接返回对象,到了WEB页面就转换成json 所以不需要使用JSON转换封装可以直接使用
代码如下 | 复制代码 |
@RequestMapping(value ="/searchList.cqzk") @ResponseBody publicBootPage throwsServletException,IOException,RuntimeException{ Object obj=session.getAttribute("page"); BootPage pagger.setSearchfield(page.getSearchfield()); pagger.setSearchText(page.getSearchText()); illegalParkInfoService.bootstrapSearch(pagger); session.setAttribute("page", pagger); returnpagger; } |
对应的BootPage类
代码如下 | 复制代码 |
publicfinalclassBootPage protectedinttotal; protectedList protectedintlimit=10; protectedintoffset =0; protectedString order ="asc"; protectedString searchText=null; protectedString searchfield=null; publicintgetTotal() { returntotal; } publicvoidsetTotal(inttotal) { this.total = total; } publicList returnrows; } publicvoidsetRows(List this.rows = rows; } publicintgetLimit() { returnlimit; } publicvoidsetLimit(intlimit) { this.limit = limit; } publicintgetOffset() { returnoffset; } publicvoidsetOffset(intoffset) { this.offset = offset; } publicString getOrder() { returnorder; } publicvoidsetOrder(String order) { this.order = order; } publicString getSearchText() { returnsearchText; } publicvoidsetSearchText(String searchText) { this.searchText = searchText; } publicString getSearchfield() { returnsearchfield; } publicvoidsetSearchfield(String searchfield) { this.searchfield = searchfield; } } |
-
上一个: C#实现的文件操作封装类完整实例
相关文章
- C#复制数组的两种方式及效率比较解读 10-24
- ASP.NET Identity用法解析 10-24
- ASP.NET MVC使用Identity增删改查用户介绍 10-24
- C语言中atoi函数模拟实现介绍 10-18
- .Net反向代理组件Yarp用法介绍 10-10
- .NET使用YARP通过编码方式配置域名转发实现反向代理教程 10-10