Spring MVC下 bootStrap服務器分頁代碼。本站提示廣大學習愛好者:(Spring MVC下 bootStrap服務器分頁代碼)文章只能為提供參考,不一定能成為您想要的結果。以下是Spring MVC下 bootStrap服務器分頁代碼正文
因為Spring 對於ajax直接返回對象,到了WEB頁面就轉換成json 所以不需要使用JSON轉換封裝可以直接使用
<span > </span>@RequestMapping(value = "/searchList.cqzk") @ResponseBody public BootPage<IllegalParkInfo> search(BootPage<IllegalParkInfo> page,HttpServletRequest request,HttpServletResponse response,HttpSession session) throws ServletException,IOException,RuntimeException{ Object obj=session.getAttribute("page"); BootPage<IllegalParkInfo> pagger=(BootPage<IllegalParkInfo>) obj; pagger.setSearchfield(page.getSearchfield()); pagger.setSearchText(page.getSearchText()); illegalParkInfoService.bootstrapSearch(pagger); session.setAttribute("page", pagger); return pagger; }
對應的BootPage類
public final class BootPage<T> { protected int total; protected List<T> rows; protected int limit=10; protected int offset = 0; protected String order ="asc" ; protected String searchText=null; protected String searchfield=null; public int getTotal() { return total; } public void setTotal(int total) { this.total = total; } public List<T> getRows() { return rows; } public void setRows(List<T> rows) { this.rows = rows; } public int getLimit() { return limit; } public void setLimit(int limit) { this.limit = limit; } public int getOffset() { return offset; } public void setOffset(int offset) { this.offset = offset; } public String getOrder() { return order; } public void setOrder(String order) { this.order = order; } public String getSearchText() { return searchText; } public void setSearchText(String searchText) { this.searchText = searchText; } public String getSearchfield() { return searchfield; } public void setSearchfield(String searchfield) { this.searchfield = searchfield; } }
以上所述是小編給大家介紹的Spring MVC下 bootStrap服務器分頁代碼,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對網站的支持!
[db:作者簡介][db:原文翻譯及解析]