资源简介
里面有所需的jar包,css文件和js文件,还有写的demo,从分页.js开始发送请求,action.java里查出数据,daoImpl.java是写的SQL层。
代码片段和文件信息
public String dayAllTableRain(){
try {
HttpServletRequest req = ServletActionContext.getRequest();
HttpServletResponse response = ServletActionContext.getResponse();
response.setCharacterEncoding(“UTF-8“);
req.setCharacterEncoding(“UTF-8“);
int page=0;//第几页
int rows=0;//每页显示的条数
try{
page=Integer.parseInt(req.getParameter(“page“));//page和rows是jqGrid自动传过来的
rows=Integer.parseInt(req.getParameter(“rows“));
}catch(Exception e){
e.printStackTrace();
}
String beginyear = req.getParameter(“beginyear“);
// beginyear = new String(beginyear.getBytes(“ISO-8859-1“) “UTF-8“);
// beginyear = beginyear.substring(0beginyear.length()-1);
String endyear = req.getParameter(“endyear“);
// endyear = new String(endyear.getBytes(“ISO-8859-1“) “UTF-8“);
// endyear = endyear.substring(0endyear.length()-1);
// System.out.println(“endyear“+endyear);
String month = req.getParameter(“month“);
// month = new String(month.getBytes(“ISO-8859-1“) “UTF-8“);
// month = month.substring(0month.length()-1);
String day = req.getParameter(“day“);
// day = new String(day.getBytes(“ISO-8859-1“) “UTF-8“);
// day = day.substring(0day.length()-1);
Map map = new HashMap();
map.put(“beginyear“ beginyear);
map.put(“endyear“ endyear);
map.put(“month“ month);
map.put(“day“ day);
map.put(“rows“ rows);
map.put(“page“ page);
PageInfo pageInfo = this.hRainService.dayAllQuery(map);//一个对象,所以是
PrintWriter writer = response.getWriter();
JSONobject jsondata = JSONobject.fromobject(pageInfo);//json对象,不是数组
writer.print(jsondata.toString());
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-12-17 14:05 jqGrid分页\
文件 1771 2015-12-17 12:09 jqGrid分页\action.java
文件 155881 2015-12-16 19:18 jqGrid分页\bootstrap.min.css
文件 612 2015-12-17 13:14 jqGrid分页\daoImpl.java
文件 592 2015-12-17 13:12 jqGrid分页\daoImpl.java.bak
文件 9249 2015-12-16 19:18 jqGrid分页\grid.locale-cn.js
文件 84244 2015-12-16 19:18 jqGrid分页\jquery-2.1.1.min.js
文件 307113 2015-12-16 19:18 jqGrid分页\jquery.jqGrid.min.js
文件 700859 2015-12-16 19:18 jqGrid分页\mybatis-3.2.0.jar
文件 41167 2015-12-16 19:18 jqGrid分页\mybatis-spring-1.1.1.jar
文件 63363 2015-12-16 19:18 jqGrid分页\pagehelper-4.0.3.jar
文件 17692 2015-12-16 19:18 jqGrid分页\ui.jqgrid.css
文件 1550 2015-12-17 11:54 jqGrid分页\分页.js
评论
共有 条评论