Closed xela85 closed 8 years ago
The war
does not package the file in data
. And even if the file is packaged in the war, unless you deploy the war as exploded, you cannot access it with File
.
You have 3 solutions:
conf
folder and access it with getClass().getClassLoader().getResourceAsStream("bla.xml")
. You will have to change your application's code to use InputStream instead of File.conf
folder and deploy the war as exploded. Then you can access it as a File
considering you can use a path relative to where the war is deployed.I've tried the third option (exploded war) because I use an external library which requires java.io.File
. It works, thank you !
Hello,
I would like to read an Excel file containing some useful data for my web application. To do it, I did that:
The file is in the data folder which is at the root of the project (not in app). It is correctly read after an
activator dist
, but seems to be excluded after aactivator war
command.I have seen that it works if I add manually the data folder on Tomcat bin directory, but I find this quite ugly and would prefer having something self-contained. What if the server is not Tomcat?
Can you please point out what I did wrong?
Thanks in advance.