易截截图软件、单文件、免安装、纯绿色、仅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属性的值,并不是和对应类类中的属性内容是一致的


相关文档:

在XML中定义菜单

和Android UI layout一样,我们也可以在XML中定义应用程序的菜单。通过在菜单的onCreateOptionsMenu方法中膨胀菜单layout。这样做会使我们的程序代码简单多了,而且尽可能的将更多的界面设计部分放到XML,便于浏览。
 
1. 在工程的/res/文件夹下创建menu文件夹,用来保存你为应用程序定义的菜单XML文件。
在菜单XML ......

“XML DOM读取节点信息”小结

<?
XML DOM读取节点信息遇到问题总结:  
 
1:NodeList: 使用节点的childNodes属性或者document对象的getElementsByTagName()方法,就会返回一个包含节点列表的NodeList
 
2: 在 XML DOM 中,节点的关系被定义为节点的属性:
·  parentNode
·  childNodes
· ......

Java 对xml文件的读写操作

/**
* 描述:数据库初始化基本类
*
* @作者 王群
* @创建日期 2010-04-08
* @修改人 xxx
* @修改日期 xxx
* @检查人 xxx
* @检查日期 xxx
*/
import java.sql.SQLException;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.oumasoft.bstmanage.ibatis.SqlMapConfig;
import com.oumasof ......

java 自己做的对XML文件的读写操作

XML文件实例:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<Resource auth="Container" maxActive="20" name="sss" password="123"
type="javax.sql.DataSource" />
<Resource auth="Container" ......

怎么样在网页上读取远程xml的数据

 本文转自:http://www.10086web.com/html/wangluobiancheng/Xmlbiancheng/2009/0612/90.html
一个客户提供一个股价的信息,要求放在页面上,显示一些数据,需要从远程获取xml,然后解析写在网页上,开始不会觉得很难,其实蛮简单的,先用javascript写了一个:
<mce:script language=javascript><!--

......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号