I basically need to pass an argument to the WAR file that contains the path to my config.json
.
I want to achieve it in such a way so that once the project has been exported as a WAR file, I should be able to change the argument without opening the WAR file and having to export it again.
I understand I can pass arguments in the web.xml
which can be obtained in the servlet but wouldn't changing the web.xml
require me to open the WAR file?
I am using jetty-runner.jar
to deploy my webapp.
I can see 2 solution to you problem:
1) You define an environment variable that specifies the path to your config.json on the server that hosts you jetty instance
2) You add to the class path the folder that contains the config.json and access it from your web application.