标签:single eval rop 对象 加载 dom4j val 存放位置 tco
注 1:*.properties文件
Key=value
#注释
//util包下的属性文件类
Properties properties=new Properties();
//加载一个properties流
Properties.load(is);
//某一个键的值
Properties.getProperty(“键名”);
1.2 存放位置
1.2.1 src根目录下
类名:class.getresourceAsStream(“/config.properties”);
1.2.2 与读取配置文件的类在同一包
类名:class.getResourceAsStream(“config2properties.”);
1.2.3 WEB-INF(或其子目录下)
ServletContext sc=this.getServletContext();
InputStreais=sc.getResourceAsStream("/WEB-INF/test.properties");
Xpath 等同于数据库的select语句
document.selectNodes(xpath);//查一组
document.selectSingleNode(xpath);//查单个
Node
元素节点
属性节点
文本节点
SAXReader 解析器
Read(XML路径) 得到document对象
getRootElement 获取根节点
Element(节点名称) 获取根节点下的指定节点信息
attributeValue(属性名) 获取属性值
Element(节点名称) 获取节点的Element对象
getText() 获取节点的值
标签:single eval rop 对象 加载 dom4j val 存放位置 tco
原文地址:https://www.cnblogs.com/xmf3628/p/10917240.html