网站怎么屏蔽国内访问,企业网站建设公司网络,自己如何搭建网站,文昌网站 做炸饺子在进行分页操作前#xff0c;必须知道开启服务器模式后会向服务器发送的参数的含义#xff1a; length:告诉服务器每页显示的数据条数 start#xff1a;第一条数据的起始位置 draw:绘制计数器#xff0c;#xff08;特殊#xff1a;服务器接收到参数后#xff0c;需要返…在进行分页操作前必须知道开启服务器模式后会向服务器发送的参数的含义 length:告诉服务器每页显示的数据条数 start第一条数据的起始位置 draw:绘制计数器特殊服务器接收到参数后需要返回到前台 1.在前台开启服务器模式 serverSide: true 2.在后台接受前台传递过来的参数 public MapString,Object search145(UserInfo UserInfo,int length,int draw,int start) 3.在后台通过Hibernate查询结果 public MapString,Object search145(UserInfo userInfo,int length,int draw,int start){ ListUserInfo listnew ArrayListUserInfo(); MapString,Object mapnew HashMapString, Object(); int totalCount0; Session sessionnull; String hqlfrom Airline145Info where 11 try{ sessionHibUtil.getSession();//创建Session对象 Query querySelectsession.createQuery(hql);//通过调用Session对象创建Query的对象 totalCountquerySelect.list().size();//得到要查询的总记录条数 querySelect.setFirstResult(start);//将数据的起始位置加入到Query对象中 querySelect.setMaxResults(length);//将每页显示的数据条数添加到Query对象中 listquerySelect.list();//这个时候数据的条数已经改变了。为要每页显示的数据条数 }catch(Exception e){ e.printStackTrace(); }finally { closeSession(session); } map.put(draw,draw);//返回到前台 map.put(data,list);//分过页的查询结果 map.put(recordsTotal,totalCount);//查询到的数据中条数 map.put(recordsFiltered,totalCount);//有过滤条件过滤后的数据总条数 return map;} 转载于:https://www.cnblogs.com/baijingting/p/9463993.html