I have a servlet within a web app, that loads a .xls file. I put the .xls file in the .war that contains the servlet, but I can not get the servlet to find the file . So my question is : How do I use a relative path to find a file that is in a .war file from a servlet within that .war file ? Is it even possible ?
I think there are issues with getting the path from a war file. Normally I would use: String realPath = application.getRealPath("/path/from/webroot/file.xsl"); This gives you the absolute file path; however, this used to not work when you had your app in a war file. I hardly ever deploy with a war file, so I am not sure of the solution (if the above does not work). Hope this helps.