ogrid = new dhtmlXGridObject('orderBean');
ogrid.setImagePath(gridImgsPath);
ogrid.setHeader("订单号,供应商编号,供应商名称,单据类型,需求单位,采购单位,定货日期,仓库,接收地址,采办人,制定人,审批人,审批日期,制定日期,定单状态,金额,金额含税,备注");
ogrid.setInitWidths("60,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80");
ogrid.setColAlign("right,right,left,left,left,left,right,left,left,left,left,left,right,right,left,right,right,left");
ogrid.setSkin("modern");
ogrid.setColumnIds("id,supId,supName,billType,needUnit,buyUnit,orderDate,repertoryName,neederAddress,buyer,maker,assessor,auditingDate,makeDate,state,allMoney,allMoneyTax,re");
ogrid.init();
ogrid.splitAt(5);
ogrid.loadXML(webRoot +'/order.may?method=viewOrderList');我们公司用的是他,用着很方便。
http://www.dhtmlx.com/如果自已写也不是很难,通过ajax提交,对返回的xml进行解析。
ogrid.setImagePath(gridImgsPath);
ogrid.setHeader("订单号,供应商编号,供应商名称,单据类型,需求单位,采购单位,定货日期,仓库,接收地址,采办人,制定人,审批人,审批日期,制定日期,定单状态,金额,金额含税,备注");
ogrid.setInitWidths("60,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80");
ogrid.setColAlign("right,right,left,left,left,left,right,left,left,left,left,left,right,right,left,right,right,left");
ogrid.setSkin("modern");
ogrid.setColumnIds("id,supId,supName,billType,needUnit,buyUnit,orderDate,repertoryName,neederAddress,buyer,maker,assessor,auditingDate,makeDate,state,allMoney,allMoneyTax,re");
ogrid.init();
ogrid.splitAt(5);
ogrid.loadXML(webRoot +'/order.may?method=viewOrderList');我们公司用的是他,用着很方便。
http://www.dhtmlx.com/如果自已写也不是很难,通过ajax提交,对返回的xml进行解析。
自己写个前台到后台的数据绑定,用起来和c/s差不多。
URL url = new URL("http://hostname:port/servername/xxx.do");
Document document = saxReader.read(url);这样就直接得到了返回的这个 XML 文档了,然后解析封装为自己需要的数据就OK 了帖子再保留 5 天,欢迎大家提供自己的思路
比如不用 Dom4j 这样的第三方 jar 包,如何得到反回的 xml 数据
希望有高手指点一二,因为虽然问题已经解决,但对其机制还是不甚了解
这样也只能是治标不治本。期待中
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
URL url = new URL("http://hostname:port/servername/xxx.do");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true);
BufferedOutputStream hurlBufOus = null;
conn.setDoInput(true);
if(有参数){
hurlBufOus = new BufferedOutputStream(conn.getOutputStream());
hurlBufOus.write(postData.getBytes());
hurlBufOus.flush();
}
conn.connect();
BufferedReader br = new BufferedReader(
new java.io.InputStreamReader(conn.getInputStream()));//得到响应
StringBuffer sb = new StringBuffer("");
String tmp = "";
while ((tmp = br.readLine()) != null) {
sb.append(tmp);
}