123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <%@ page import="net.sf.json.*"%>
- <%@ page pageEncoding="UTF-8"%>
- <%@ page
- import ="java.util.*"%>
- <%@ page language="java"
- import="com.sysmodel.datamodel.xmlmodel.ModelFactory,
- com.sysmodel.datamodel.xmlmodel.impl.MdpDataSourceImpl,
- com.sysmodel.datamodel.xmlmodel.able.SysModel"%>
- <% request.setCharacterEncoding("GB2312");
- SysModel sysmodel = ModelFactory.getSysmodel();
- ArrayList list = sysmodel.getMdpDataSources();
-
- String callback=request.getParameter("callback");
- try{
- String json = callback+"({totalProperty:100,root:[";
- for (int i = 0; i < list.size(); i++) {
- MdpDataSourceImpl MdpDataSource = (MdpDataSourceImpl) list.get(i);
- Map map=new HashMap();
- map.put("code","<a href=\"edit.jsp?dataSourceid="+MdpDataSource.getDataSourceid()+"\">"+MdpDataSource.getDataSourceid()+"</a>");
- map.put("Description", MdpDataSource.getDescription());
- map.put("DataBase", MdpDataSource.getDataBase());
- map.put("User", MdpDataSource.getUser());
- map.put("Password", MdpDataSource.getPassword());
- map.put("JNDI", MdpDataSource.getJNDI());
- map.put("del","<a href=\"editExc.jsp?action=del&dataSourceid="+MdpDataSource.getDataSourceid()+"\">删除</a>");
-
- JSONObject jsonMap = JSONObject.fromObject(map);
- System.out.println(jsonMap);
- json += jsonMap.toString();
- if (i != (list.size() - 1)) {
- json += ",";
- }
- }
- json += "]});";
- System.out.println();
- System.out.println(json);
- System.out.println();
- response.getWriter().write(json);
- }catch(Exception e){
- System.out.println("json----error!!!");
- }%>
|