java¶Áдxml
ÕâÀï×ܽáÒ»ÏÂXMLÎļþµÄ¶Áд¹ý³Ì£¬ÏÈ˵һÏÂдµÄ¹ý³Ì£¬ÕâÀïÎÒÓõÄÊÇXmlDocumentµÄwrite·½·¨ÊµÏֵģ¬Ð´µÄ¹ý³ÌÊDZȽϼòµ¥µÄ£¬Ö»ÐèÒª¶¨Òå×Ô¼ºÏëÒªµÄÔªËرäÁ¿£¬
Element user=null;
Element username=null,password=null;
È»ºó
// ¶¨Ò幤³§£¬Ê¹Ó¦ÓóÌÐòÄܹ»´Ó XML Îĵµ»ñÈ¡Éú³É DOM ¶ÔÏóÊ÷µÄ½âÎöÆ÷¡£
DocumentBuilderFactory dbf=null;
//¶¨Òå API£¬ ʹÆä´Ó XML Îĵµ»ñÈ¡ DOM ÎĵµÊµÀý¡£Ê¹ÓôËÀ࣬ӦÓóÌÐòÔ±¿ÉÒÔ´Ó XML »ñÈ¡Ò»¸ö Document
DocumentBuilder db=null;
//ʵÀý¹¤³§
dbf = DocumentBuilderFactory.newInstance();
//ʵÀýdocumentBuilder¶ÔÏó
db = dbf.newDocumentBuilder();
//ʵÀýXmlDocument±äÁ¿
doc = new XmlDocument();
ÊÖ¶¯»ò´ÓÊý¾Ý¿âÀï²éÊý¾ÝΪÆ丳ֵ£¬
username="helloxml";
password="pass";
ʵÀýÔªËرäÁ¿
user = doc.createElement("UserInfomation");
//ʵÀýelement±äÁ¿
username = doc.createElement("UserName");
username.appendChild(doc.createTextNode(username1));
user.appendChild(username);
¡£¡£¡£¡£¡£
//ÔÙÓÃXmlDocument¶ÔÏódoc½«¸ùÔªËص½xmlÎĵµ
doc.appendChild(user);
×îºóͨ¹ýwrite·½·¨½«Æäдµ½Ö¸¶¨µÄÎļþÖÐ
if (path == null || path.equals("")) {
path = "E:/user.xml";
}
try
{
//½«Êä³ö·¾¶Í¨¹ýOutputStreamWriter
OutputStreamWriter out = new OutputStreamWriter(
new BufferedOutputStream(new FileOutputStream(path)), "UTF-8");
//ÀûÓÃXmlDocumentµÄwrite·½·¨Ð´³öxmlÎļþ
doc.write(out, "UTF-8");
out.close();
 
Ïà¹ØÎĵµ£º
Ò»¡¢µ÷ÓÃÊôÐÔÎļþÊôÐԵĴúÂ룺
String url=SmsProperties.get("sms_address_frontend");//È¡µØÖ·Èç“sms_address_frontend=http://172.16.1.9:8280/sms_frontend/services/smsSenderWebService”
String smsServer = SmsProperties.get("sms_server_name");//·¢ËͶÌÐŵķþÎñÕ˺Å(ÕâÀï¿ÉÒÔÈ¡ÖÐÎÄÊôÐ ......
package com.mapabc.sz_hbt.util;
/**
* <p>Title:ÕûÐÍÓ볤¶ÈΪ4µÄ×Ö½ÚÊý×éµÄ»¥»» </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2007-5-10</p>
* <p>Company: www.mapabc.com</p>
* @author luoyj
* @version 1.0
*/
public class Byte ......
ÌáÆðJavaÄÚ²¿ÀࣨInner Class£©¿ÉÄܺܶàÈ˲»Ì«ÊìϤ£¬Êµ¼ÊÉÏÀàËƵĸÅÄîÔÚC++ÀïÒ²ÓУ¬ÄǾÍÊÇǶÌ×ÀࣨNested Class£©£¬¹ØÓÚÕâÁ½ÕßµÄÇø±ðÓëÁªÏµ£¬ÔÚÏÂÎÄÖлáÓжԱȡ£ÄÚ²¿Àà´Ó±íÃæÉÏ¿´£¬¾ÍÊÇÔÚÀàÖÐÓÖ¶¨ÒåÁËÒ»¸öÀࣨÏÂÎĻῴµ½£¬ÄÚ²¿Àà¿ÉÒÔÔںܶàµØ·½¶¨Ò壩£¬¶øʵ¼ÊÉϲ¢Ã»ÓÐÄÇô¼òµ¥£¬Õ§¿´ÉÏÈ¥ÄÚ²¿ÀàËƺõÓÐЩ¶àÓ࣬ËüµÄÓô¦¶ÔÓÚ³õ ......
OOµÄ¾«Ë裬ÎÒÒÔΪ£¬ÊǶԶÔÏóµÄ³éÏó£¬×îÄÜÌåÏÖÕâÒ»µãµÄ¾ÍÊǽӿڡ£ÎªÊ²Ã´ÎÒÃÇÌÖÂÛÉè¼Æģʽ¶¼Ö»Õë¶Ô¾ß±¸Á˳éÏóÄÜÁ¦µÄÓïÑÔ£¨±ÈÈçc++¡¢java¡¢c#µÈ£©£¬¾ÍÊÇÒòΪÉè¼ÆģʽËùÑо¿µÄ£¬Êµ¼ÊÉϾÍÊÇÈçºÎºÏÀíµÄÈ¥³éÏó¡££¨cowboyµÄÃûÑÔÊÇ"³éÏó¾ÍÊdzéÈ¥ÏñµÄ²¿·Ö"£¬¿´ËƵ÷Ù©£¬ÊµÄËÖÁÀí£©¡£
Éè¼ÆģʽÖÐ×î»ù´¡µÄÊǹ¤³§Ä£Ê½£¨Factory£©£¬ÔÚÎÒ×î ......
±ðµÄ¶¼²»ËµÁË£¬ÎҵĸоõÊÇѧϰµ½ÁËÒ»ÖÖ¿ò¼ÜµÄ˼Ï룺¾ÍÊÇ¿ª·¢Ò»¸ö»ù´¡¿ò¼Ü£¬È»ºóÕâ¸ö¿ò¼ÜÔÙ±ðµÄµØ·½Ò»Ñù¿ÉÒÔʹÓã¡
±È½ÏÖØÒªµÄ֪ʶµã:
1: HTTP ÐÒé½âÎö£¬
2£º·â×°response ¡¢request
3£º¸øϵͳ¶¨ÖÆÈÕÖ¾×é¼þ
4£º¸øϵͳÌí¼ÓÅäÖÃÎļþ£¬Ôö¼ÓÁËϵͳµÄÁé»îÐÔºÍñîºÏÐÔ.ÕâÀïÖ÷ÒªÊÇÓõÄÒ»¸ö¿ªÔ´ÏîÄ¿£¨¾Ý˵Tomcat¾ÍÊÇÓõÄÕâ¸ö¿ªÔ ......