duffymo Martin McNulty, getResourceAsStream Excel, :
webapp - - , ?
- Application Root
|
+- WEB-INF
|
+- classes/ <--- This is added to CLASSPATH
|
+- lib/ <--- Its contents are added to CLASSPATH
|
+- web.xml
JAR, lib . IDE , , .class , Java, , .
, ... , Excel, , .
Excel , , JAR WAR, .
The Class.getResourceAsStream (String path) method gives you access to files in the classpath, just pass the path replacing the dots with a slash, for example:
getClass().getResourceAsStream("/yourpackage/YourExcelFile.xsl");
will provide you with an InputStream of the YourExcelFile.xsl file, which is located inside yourpackage package.
I tried to explain this to you, but if in doubt, you can check the documentation.
source
share