再来个更加复杂一点的XML <?xml version="1.0" encoding="ISO-8859-1" ?> <database> <tables> <table tableType="system"> <name>users</name> <fields> <field> <name>uid</name> <type>long</type> </field> < ...
读取XML 假如有个XML,名叫:XMLtest.xml如下: <?xml version="1.0" encoding="ISO-8859-1" ?> <gui-definition> <colors> <background>#808080</background> <text>#000000</text> <header>#008000</header> <link normal="#000080" visited="#800080"/> <default>${co ...
如果你确定要解析的文件是properties 那么你完全可以使用 PropertiesConfiguration config = new PropertiesConfiguration("tt/t.properties"); 代替 Configuration config = new PropertiesConfiguration("tt/t.properties"); 这么写似乎不符合面向接口编程,但是它可以使用PropertiseConfiguration中特殊的方法。 比如,你如果你想修改propertise文件,那么可以这样: config.setProperty("id" ...
  • 22:26
  • 浏览 (37)
  • 评论 (0)
Apache Commons-configuration 学习笔记 1 如果要使用configuration这个包,首先要保证使用JDK1.2以上,还要引入如下jar包 commons-beanutils commons-lang commons-logging commons-collections commons-digester commons-codec commons-jxpath 2 commons-configuration最新的版本是1.5,最主要的作用是读取资源文件,每一种文件格式都有一个对应的类,如下 properties文件--PropertiesConfigura ...
  • 17:02
  • 浏览 (60)
  • 评论 (0)
wangxin0072000
搜索本博客
博客分类
最近加入圈子
存档
最新评论