Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Java²Ù×÷XMLÎļþ dom4j ƪ£¨×ªÔØ£©


ÔÚÏîÄ¿ÖУ¬ÎÒÃǺܶ඼Óõ½ÁËxmlÎļþ£¬ÎÞÂÛÊDzÎÊýÅäÖû¹ÊÇÓëÆäËüϵͳµÄÊý¾Ý½»»¥¡£
½ñÌì¾ÍÀ´½²Ò»ÏÂJava ÖÐʹÓÃdom4jÀ´²Ù×÷XMLÎļþ¡£
ÎÒÃÇÐèÒªÒýÈëµÄ°ü£º
//Îļþ°ü
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileWriter;
//¹¤¾ß°ü
import java.util.Iterator;
import java.util.List;
//dom4j°ü
import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter;
1¡¢½«XMLÎļþµÄÄÚÈÝת»¯ÎªString
   /**
    * doc2String
    * ½«xmlÎĵµÄÚÈÝתΪString
    * @return ×Ö·û´®
    * @param document
    */
   public static String doc2String(Document document)
   {
      String s = "";
      try
      {
           //ʹÓÃÊä³öÁ÷À´½øÐÐת»¯
           ByteArrayOutputStream out = new ByteArrayOutputStream();
           //ʹÓÃGB2312±àÂë
           OutputFormat format = new OutputFormat("  ", true, "GB2312");
           XMLWriter writer = new XMLWriter(out, format);
           writer.write(document);
           s = out.toString("GB2312");
 


Ïà¹ØÎĵµ£º

JAVA »ñÈ¡±¾ÖܵÄÆðʼÈÕÆÚ troy

import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;
/**
 * @author troy(J2EE)
 * @version 1.0
 */
public class Test {
 public static void main(String[] args) throws Exception {
  DateFormat df = DateFormat.getDateInstance();
 &n ......

java¶àÏß³Ìѧϰ

¹ØÓÚ Java Concurrency
 
   ×Ô´ÓJavaµ®Éú֮ʱ£¬Java ¾ÍÖ§³Ö²¢ÐеĸÅÄ±ÈÈçÏ̺߳ÍËø»úÖÆ¡£Õâ¸ö½Ì³Ì°ïÖú¿ª·¢¶àÏß³ÌJava³ÌÐòÔ±Äܹ»Àí½âºËÐĵÄJava²¢ÐÐÀíÄîÒÔ¼°ÈçºÎʹÓÃËûÃÇ¡£ ÄÚÈÝÉæ¼°µ½JavaÓïÑÔÖеÄỊ̈߳¬ ÖØÁ·¼¶ÒÔ¼°ÇáÁ¿¼¶Í¬²½»úÖÆ ÒÔ¼°JavaSE 5 ÖеÄËø£¬Ô­×ÓÁ¿ ²¢ÐÐÈÝÆ÷£¬Ï̵߳÷¶È ÒÔ¼°Ïß³ÌÖ´ÐÐÕß ......

java script »ñµÃLabel¿Ø¼þÄÚÈÝ

 var ProjectName = document.getElementById("<%=ProjectName.ClientID%>").innerText;
       ProjectName = ProjectName.replace(/(^\s*)|(\s*$)/g, ""); // Ï൱ÓÚTrim()º¯Êý ......

java²¹Âë ·´Âë

¹Ø¼ü×Ö: µ×²ãÊý¾Ý Ãû´Ê½âÊÍ£º ²¹Â룺1 ÔÚ¼ÆËã»úϵͳÖУ¬ÊýÖµÒ»ÂÉÓв¹ÂëÀ´±íʾ(´æ´¢). ʹÓò¹Âë,¿ÉÒÔ½«·ûºÅλºÍÆäËûλͳһ´¦Àí;ͬʱ,¼õ·¨Ò²¿É°´¼Ó·¨À´´¦Àí.ÁíÍâ,Á½¸öÓò¹Âë±íʾµÄÊý¾ÝÏà¼Óʱºò,Èç¹û×î¸ßλ(·ûºÅλ)Óнøλ,Ôò½øÎ¥±»ÉáÆú. 2 ²¹ÂëÓëÔ­ÂëµÄת»»¹ý³Ì¼¸ºõÊÇÏàͬµÄ ÊýÖµµÄ²¹Âë±íʾҲ·ÖÁ½ÖÖÇé¿ö£º £¨1£©ÕýÊýµÄ²¹Âë:ÓëÔ ......

REST¼Ü¹¹ÓëJavaʵÏÖ1——REST¸ÅÄî

ÓÉÓÚÓиöºÏ×÷ÏîÄ¿£¬Óõ½ÁËREST£¬ÎÒÃÇÕâ±ßµÄ·þÎñÆ÷ÊÇjavaµÄ£¬ºÏ×÷·½ÄDZßÖ÷ÒªÊÇPHP»·¾³£¬ÎªÁËÔ¶³Ìµ÷ÓõÄÎÊÌ⣬ʹÓÃÁËREST×÷ΪAPIµÄʵÏÖ·½
°¸¡£ÏÖÔÚÏîÄ¿×öµÃ²î²»¶àÁË£¬ÏÂÃæ¼ÇÏÂ×Ô¼ºµÄÒ»µãÐĵã¬ËãÊDZʼǰɡ£
    REST£¨Representational State Transfer£©µÄ˵·¨À´×Ô“Architectural Styles and the Desi ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ