<%@ page import="net.sf.json.*"%> <%@ page pageEncoding="UTF-8"%> <%@ page contentType="text/html; charset=UTF-8" language="java" %> <%@ page import ="java.util.*"%> <%@ page language="java" import="com.sysmodel.XFormFactory, com.sysmodel.listmodel.xmlmodel.impl.FormListImpl, com.sysmodel.datamodel.xmlmodel.ModelFactory, com.sysmodel.datamodel.xmlmodel.able.SysModel"%> <% String begin=request.getParameter("start"); String size=request.getParameter("limited"); String callback=request.getParameter("callback"); request.setCharacterEncoding("GBK"); List list = XFormFactory.getXFormModel().getFormLists(); String moduleType = request.getParameter("type") == null? "" :request.getParameter("type"); if(moduleType.equals("")){ list = XFormFactory.getXFormModel().getFormLists(); }else{ list = XFormFactory.getXFormModel().getFormListByType(moduleType); } try{ int index = Integer.parseInt(begin); int pageSize = Integer.parseInt(size); System.out.println(pageSize); String json = callback+"({totalProperty:100,root:["; SysModel sysmodel = ModelFactory.getSysmodel(); FormListImpl FormList = new FormListImpl(); for (int i = 0; i < list.size(); i++) { FormList = (FormListImpl) list.get(i); String listid = FormList.getListid() == null ? "" : FormList.getListid(); String title = FormList.getDescription() == null ? "" :FormList.getDescription(); String refreshTime = FormList.getRefreshTime() == null ? "" :FormList.getRefreshTime(); String titleWidth = FormList.getListWidth() + ""; String type1 =sysmodel.getMdpModuleByCode(FormList.getType()).getName() == null ? "" :sysmodel.getMdpModuleByCode(FormList.getType()).getName(); String del = "删除"; Map map = new HashMap(); map.put("listid",listid); map.put("title", title); map.put("refreshTime",refreshTime); map.put("titleWidth", titleWidth); map.put("type", type1); map.put("del", del); JSONObject jsonMap = JSONObject.fromObject(map); System.out.println(jsonMap); json += jsonMap.toString(); if (i != pageSize) { json += ","; } } json += "]});"; System.out.println(); System.out.println(json); System.out.println(); response.getWriter().write(json); }catch(Exception e){ } %>