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属性的值,并不是和对应类类中的属性内容是一致的
相关文档:
AJAX (异步 JavaScript 和 XML) 是个新产生的术语,专为描述JavaScript的两项强大性能.这两项性
能在多年来一直被网络开发者所忽略,直到最近Gmail, Google suggest和google Maps的横空出世才使人
们开始意识到其重要性.
这两项被忽视的性能是:
* 无需重新装载整个页面便能向服务器发送请求.
* 对XML文档的解析和处理.
......
本文转自:http://www.10086web.com/html/wangluobiancheng/Xmlbiancheng/2009/0612/90.html
一个客户提供一个股价的信息,要求放在页面上,显示一些数据,需要从远程获取xml,然后解析写在网页上,开始不会觉得很难,其实蛮简单的,先用javascript写了一个:
<mce:script language=javascript><!--
......
1,浅串行化:只串行化类的公共字段和属性
公共属性必须是可读且可写的
使用命名空间:using System.Xml.Serialization;
以Book类为例:
串行化模板:
public ......
在web.config做參數設定時遇到特殊字元 value="http://www.yahoo.com.tw/default.aspx?sid=111111111&uid=test"
&uid這地方會出錯...換成&uid 就OK了~~
幾個
對照如下:
< 小於
<
> 大於
>
&
& ......