xml/propertiesÎļþµÄÏ໥±£´æ×ª»¯
/*
Á·Ï°Ê¹ÓÃjava.util.propertiesÀà°üÀ´²Ù×÷propertes¼°XMLÎļþ,ͨ¹ýstore·½·¨µÄµ÷ÓÿÉʵÏÖxml/propertiesÎļþµÄÏ໥±£´æ×ª»¯
*/
import java.util.*;
import java.io.*;
public class TestPropertes
{
public static void main(String[] args) {
Properties pp = new Properties();
FileInputStream in = null;
FileInputStream xmlin = null;
FileOutputStream out = null;
PrintStream ps=null;
FileOutputStream xmlout =null;
try{
in = new FileInputStream("c:/Test.Properties");
}catch(FileNotFoundException e)
{
System.out.println("propertiesÎļþûÓÐÕÒµ½");
}
try
{
pp.load(in);
}catch(IOException e)
{
System.out.println(e+"µ÷ÓÃload·½·¨Ê±³öÏÖÒì³£");
}
System.out.println(pp.getProperty("log4j.rootLogger"));
System.out.println(pp.getProperty("log4j.appender.A"));
System.out.println(pp.getProperty("log4j.appender.A1.layout"));
try
{
ps = new PrintStream("c:/TestMemo.txt");
out = new FileOutputStream("c:/Test.Properties");
}catch(IOException e1)
{
System.out.println(e1+"PrintStream creat Error");
}
pp.list(ps); //½«propertiesÎļþÓÃlist·½·¨¶ÁÈ¡²¢´æÈëpsÎļþÖÐ
//¸ü¸Ä¼üÖµ
Object o =pp.setProperty("log4j.rootLogger","DEBUG,B"); //¸ü¸Ä¶ÔÓ¦µÄHASHTABLEÖеÄÖµ£¬Êµ¼ÊÉÏÎļþÖеÄֵû±ä»¯
System.out.println(pp.getProperty("log4j.rootLogger"));
pp.list(ps); //½«¼üÖµ¸ü¸ÄºóµÄpropertiesÎļþÓÃlist·½·¨¶ÁÈ¡²¢´æÈëpsÎļþÖÐ.list»á×Ô¶¯ÒÔ×·»ØµÄ·½Ê½´ÓÔÎļþβдÈë
System.out.println(o.getClass());
try
{
&nbs
Ïà¹ØÎĵµ£º
½ñÌìÔÚÔËÓÃspringµÄPropertyPlaceholderConfigurerʱ·¢ÏÖÒ»¸öÓÐÒâ˼µÄÄÚÈÝ£¬µ±ÄãÔÚapplicationContextÖÐÅäÖÃÒ»¸öPropertyPlaceholderConfigurerµÄbeanʱ£¬ÓÐlocationºÍlocationsµÄÊôÐÔ£¬²»Ã÷˼Òâlocation¶ÔÓ¦Ò»¸ö.propertiesÎļþ£¬
locations¶ÔÓ¦¶à¸ö.propertiesÎļþ£¬³å×ÅÏë¿´Ò»ÏÂPropertyPlaceholderConfigurerµÄʵÏÖ»úÖ ......
Internet Explorer 5.0 ¶Ô XML ÌṩÄĸö¼¶±ðµÄÖ§³Ö£¿
¡¡¡¡Internet Explorer 5 ÌṩÏÂÁÐ XML Ö§³Ö£º
¡¡¡¡Ö±½Ó²é¿´ XML¡£Microsoft XML ʵÏÖÔÊÐíÓû§Í¨¹ýËûÃÇµÄ Web ä¯ÀÀÆ÷ʹÓà XSL »òÕß²ãµþÑùʽ±í (CSS) ²é¿´ XML£¬¾ÍÏó²é¿´ HTML ÎĵµÒ»Ñù¡£
¡¡¡¡¸ßÐÔÄÜ¡¢ÑéÖ¤ XML ÒýÇæ¡£Internet Explorer 4.0 ¿ª·¢ÈËÔ±ÊìϤµÄ XML ÒýÇ ......
ÈçºÎ¼ÓÔØÓÐÍâ¹úºÍÌØÊâ×Ö·ûµÄÎĵµ£¿
¡¡¡¡Îĵµ¿ÉÒÔ°üº¬Íâ¹ú×Ö·û£¬ÀýÈ磺
¡¡¡¡foreign characters (úóí?)
¡¡¡¡ÀýÈç íá µÄÍâ¹ú×Ö·û±ØÐëÔÚÇ°Ãæ¼ÓÉÏ escape ÐòÁС£Íâ¹ú×Ö·û¿ÉÒÔÊÇ UTF-8 ±àÂë»òÓò»Í¬±àÂëÖ¸¶¨£¬ÈçÏÂËùʾ£º
¡¡¡¡foreign characters (íá)
¡¡¡ ......
ÒÑÖªÓÐÒ»¸öXMLÎļþ£¨bookstore.xml£©ÈçÏ£º
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="fantasy" ISBN="2-3631-4">
<title>Oberon's Legacy</title>
<author>Corets, Eva</author>
<price>5.95</price>
</book>
</booksto ......