Мелоч
This commit is contained in:
@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user