獲取xml配置文件中參數demo

	public static String getParameter(String name) {
		String xpath = "/webapp-configs/param[@name='" + name + "']/@value";
		Node node = instance.configDocument.selectSingleNode(xpath);
		if (node == null) {
			instance.logger.error("配置參數[" + name + "]不存在");
			return "";
		}
		return node.getText();
	}

發佈了22 篇原創文章 · 獲贊 80 · 訪問量 12萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章