您好,登錄后才能下訂單哦!
因為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服務器分頁代碼,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對億速云網站的支持!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。