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();
}
获取xml配置文件中参数demo
最新推荐文章于 2022-07-08 10:58:52 发布