- 注册时间
- 2012-5-12
- 最后登录
- 2019-4-2
- 阅读权限
- 10
- 积分
- 40
- 精华
- 0
- 帖子
- 11
|
fcrong 发表于 2012-5-14 09:07
从服务端返回的JSON结构:
{
total: 100, //总记录数
老大 帮忙看看 代码:
public ActionForward doSearchAllCust(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception{
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
//查询条件
String key = request.getParameter("key");
String customername=request.getParameter("customername");
//分页
int pageIndex =Integer.parseInt(request.getParameter("pageIndex"));
int pageSize = Integer.parseInt(request.getParameter("pageSize"));;
//字段排序
String sortField = request.getParameter("sortField");
String sortOrder = request.getParameter("sortOrder");
HashMap result = SearchAllCust(key,customername, pageIndex, pageSize, sortField, sortOrder);
String json = PluSoft.Utils.JSON.Encode(result);
System.out.println(json);
response.getWriter().write(json);
return null;
}
打印的结果:
{"total":"70","data":[{"month":5,"memo":"备注","day":4,"year":1993,"Integral":0,"flag":0,"CustomerName":"测试","tel":"13971251443","id":72},.......
为什么不会产生翻页呢,java版本的demo例子里面也没有分页 总数量都是0。
|
|