Мелоч

This commit is contained in:
2021-09-03 10:39:53 +06:00
parent c19e513a5e
commit 9648554d7c
9 changed files with 90 additions and 86 deletions

View File

@ -20,6 +20,7 @@ import javax.xml.xpath.XPathFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
@ -71,12 +72,12 @@ public class DBMSTree implements ServletContextAware {
//Load DB configuration from "config.xml"
try {
String fullPath = context.getRealPath("/WEB-INF/config.xml");
File fXmlFile = new File(fullPath);
//String fullPath = context.getRealPath("/WEB-INF/config.xml");
//File fXmlFile = new File(fullPath);
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(fXmlFile);
//Document doc = dBuilder.parse(fXmlFile);
Document doc = dBuilder.parse(new ClassPathResource("config.xml").getInputStream());
Element nMain = doc.getDocumentElement();
NodeList nl = nMain.getChildNodes();
for (int i = 0; i < nl.getLength(); i++) {