String scid = request.getParameter("cid");
String scurrentPage = request.getParameter("currentPage");
String srows = request.getParameter("rows");
String rname = request.getParameter("rname");
//rname=new String(rname.getBytes("iso-8859-1"),"utf-8");
// System.out.println(rname);
// System.out.println(scurrentPage);
int cid=0;
if (scid != null && scid.length()>0){
cid=Integer.parseInt(scid);
}
int currentPage=0;
if (scurrentPage !=null && scurrentPage.length()>0){
currentPage=Integer.parseInt(scurrentPage);
}else {
currentPage=1;
}
int rows=0;
if (srows !=null && srows.length()>0){
rows=Integer.parseInt(srows);
}else {
rows=5;
}
PageBean<Route> pb = rs.findAllByPage(cid, currentPage, rows,rname);
ObjectMapper om=new ObjectMapper();
response.setContentType("application/json;charset=utf-8");
om.writeValue(response.getOutputStream(),pb); |
|