<%@ page contentType="text/html; charset=UTF-8" language="java"%> <%@ page language="java" import="model.setup.constant.Collection" %> <%@ page language="java" import="com.sysmodel.datamodel.xmlmodel.ModelFactory, com.sysmodel.datamodel.xmlmodel.able.MdpConstant, com.sysmodel.datamodel.xmlmodel.able.Property, com.sysmodel.datamodel.xmlmodel.able.Template, com.sysmodel.datamodel.xmlmodel.DataContent, java.io.PrintWriter, java.util.*"%> 常量信息维护 <% String nodeID = request.getParameter("nodeID")==null?"":(String)request.getParameter("nodeID") ; String codeName =request.getParameter("codeName") == null ? "" : request.getParameter("codeName"); Collection cs = new Collection(nodeID,codeName,request.getContextPath()); MdpConstant constant = ModelFactory.getSysmodel().getMdpConstantByName(codeName); List array_elements = constant.getListDataContent(); DataContent dataContent = null; Template template = constant.getTemplate(); List listProperty = template.getListproperty(); int icols = listProperty.size(); PrintWriter pw = response.getWriter(); String lineUrl = ""; StringBuffer sb = new StringBuffer(); sb.append("["); for (int i = 0; i < array_elements.size(); i++) { dataContent = (DataContent)array_elements.get(i); String tempNodeId = (String)dataContent.getValue("fd_code"); lineUrl = "list.jsp?nodeID="+tempNodeId+"&codeName="+codeName; sb.append("{"); for (int j = 0; j < icols; j++) { Property property = (Property)listProperty.get(j); String showName = ""; Object obj = dataContent.getValue(property.getName()); if(obj instanceof java.math.BigDecimal){ showName = obj.toString(); } else { showName = dataContent.getValue(property.getName()) == null ? "" : (String)dataContent.getValue(property.getName()); } if(j != 0) sb.append(","); sb.append("\""+property.getName()+"\":\""+ showName +"\""); } sb.append(",\"edit\":\"修改\""); sb.append(",\"delete\":\"\""); sb.append("}"); if(i != array_elements.size() - 1) sb.append(","); } sb.append("]\n"); response.setContentType("text/html;charset=utf-8"); response.getWriter().write(sb.toString()); response.getWriter().flush(); response.getWriter().close(); %>