ajax ·¢ËÍxmlÎļþ£¬java½ÓÊÜxmlÎļþ²¢½âÎö
ºìÉ«×ÖÌåΪÖ÷Òª´úÂë
jspÒ³ÃæÖÐ
<script language="javascript">
function updateDB(operate){
var objDom=new ActiveXObject("msxml.DomDocument");
var objRoot=objDom.createElement("All");
objDom.appendChild(objRoot);
var k=document.getElementsByName("check"); //Ñ¡Ôñ¿ò
for(var i=0;i<k.length;i++){
if(k[i].checked){ //½«Ñ¡ÔñµÄÊý¾Ý×éºÏ³Éxml¸ñʽµÄÊý¾Ý
var currentRow=k[i].parentNode.parentNode;
var obj=objDom.createElement("Good");
objRoot.appendChild(obj);
var objNode=objDom.createElement("xl_id");
objNode.text=k[i].value;
obj.appendChild(objNode);
objNode=objDom.createElement("xqnum");
objNode.text=currentRow.cells[5].childNodes[0].value;
obj.appendChild(objNode);
objNode=objDom.createElement("desc");
objNode.text=currentRow.cells[7].childNodes[0].value;
obj.appendChild(objNode);
}
}
ajaxSendPost("qgApplyAction.do?method="+operate.name,objDom,null);//×Ô¼º·â×°µÄajaxÇëÇó µÚÒ»¸ö²ÎÊýΪurl,µÚ¶þ¸öΪ´«ËͲÎÊý£¬µÚÈý¸öÊǻص÷º¯Êý
}
</script>
ºǫ́action.java´úÂë½ÓÊÕxmlÎļþ ´úÂëÈçÏÂ
ÒýÈëµÄ°üÈçÏÂ
import org.w
Ïà¹ØÎĵµ£º
ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1 List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Xml;
using System.IO;
using System.Data;
using System.Dat ......
¼¯ºÏÀà˵Ã÷¼°Çø±ð
Collection
©ÀList
©¦©ÀLinkedList
©¦©ÀArrayList
©¦©¸Vector
©¦¡¡©¸Stack
©¸Set
Map
©ÀHashtable
©ÀHashMap
©¸WeakHashMap
Collection½Ó¿Ú
¡¡¡¡CollectionÊÇ×î»ù±¾µÄ¼¯ºÏ½Ó¿Ú£¬Ò»¸öCollection´ú±íÒ»×éObject£¬¼´CollectionµÄÔªËØ£¨Elements£©¡£Ò»Ð©
CollectionÔÊÐíÏàͬµÄÔªËØ¶øÁíһЩ²»ÐС ......