I have a file named configuration.xml which resides in classes folder of my WEB-INF directory
I try to read it using class.getResource("/configuration.xml").path();
But am not able to read the file as it is inside the WAR file.
Can any one suggest me on how to do this ?
Use
getResourceAsStream(), rather thangetResource(). This will give you a directInputStreamreference, rather than a URL, and will work for resources packed inside a JAR/WAR.