易截截图软件、单文件、免安装、纯绿色、仅160KB

spring xml中的propery 的name属性名自来源

今天在运用spring的PropertyPlaceholderConfigurer时发现一个有意思的内容,当你在applicationContext中配置一个PropertyPlaceholderConfigurer的bean时,有location和locations的属性,不明思意location对应一个.properties文件,
locations对应多个.properties文件,冲着想看一下PropertyPlaceholderConfigurer的实现机制,于是查看了spring的源码,发现在PropertyPlaceholderConfigurer中并没有location和locations的属性,于是一路向上在父类PropertiesLoaderSupport中找到了locations的属性,但是没有location属性,奇怪?但在PropertiesLoaderSupport中却有setLocation和setLocations两个方法:
/**
  * Set a location of a properties file to be loaded.
  * <p>Can point to a classic properties file or to an XML file
  * that follows JDK 1.5's properties XML format.
  */
 public void setLocation(Resource location) {
  this.locations = new Resource[] {location};
 }
 /**
  * Set locations of properties files to be loaded.
  * <p>Can point to classic properties files or to XML files
  * that follow JDK 1.5's properties XML format.
  */
 public void setLocations(Resource[] locations) {
  this.locations = locations;
 }
这样看来applicationContext.xml中的bean的property的name属性的值,并不是和对应类类中的属性内容是一致的


相关文档:

IsolatedStorageFile 本地数据缓存 xml dataset 读写

IsolatedStorageFile:包含文件和数据的独立存储区
dataset数据存储到本地xml文档,代码处理如下
public static void WriteDataToXML(DataSet dataset, string dataname)
{
try
{
IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForAssembly(); / ......

javascript动态装入XML数据


使用javascript创建Microsoft XML DOM,就可以完成这一工作.
// 装入数据.
var source = new ActiveXObject("Microsoft.XMLDOM");
source.async = false
source.load("history.xml");
// 装入样式表.
var stylesheet = new ActiveXObject("Microsoft.XMLDOM");
stylesheet.async = false
stylesheet.load( ......

FLASH加载xml,txt,swf


首先,加载TXT实例:
代码:
虽然是很旧的一套教程,可是很实用,所以我把它放在这。
(注意:看代码的时候留意一下节点的用法:myXML.childNodes[0].childNodes[0].childNodes[0]....xml节点的地方。)
一、建立XML对象:
var myXML = new XML();
二、引用XML文件:
myXML.load("data.xml");
三、忽略空格:
my ......

XML特殊符號

在web.config做參數設定時遇到特殊字元 value="http://www.yahoo.com.tw/default.aspx?sid=111111111&uid=test"
&uid這地方會出錯...換成&amp;uid 就OK了~~
幾個
對照如下:
< 小於
&lt;
> 大於
&gt;
&
&amp ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号