get path - Store xml files in resources folder (WAR), read from code
I have different XML-files in my 'src/main/recources' folder, and I'd like to read them from my webapplication.
File f = new File("file1.xml"); f.getAbsolutePath();
The code gets invoked inside a WebService, and this prints out 'C:\Users\Administrator' when I look inside the Tomcat-server-output. My current solution is to put the 'file1.xml'-documents outside of the WAR, in the 'C:\'-folder but this way my WAR is not transferable.
I've also tried
<bean name="webService"> <property name="document"> <value>classpath:file1.xml</value> </property> </bean>
But that just prints out the "classpath:file.xml" without parsing it.