I like to put an XML file in ‘/src’ directory then access the file in my classes.
I tried the following paths but didn’t work.
new File("/src/myxml.xml");
new File("src/myxml.xml");
new File("myxml.xml");
How do I access the file?
Edited:
- I’m running a tomcat 7 in Eclipse to run my struts2
- I’ve made a class in /src/com.test.test.classes
- I’ve uploaded an xml file called myxml.xml in /src
in one of my classes in /src/com.test.test.classes/, How do I access the XML file?
You don’t say how you’re running the program, which makes it substantially more difficult to be helpful. Here’s a bunch of Q & A & Suggestions, any of which will solve the problem, depending on what the problem actually is.