Load properties file external to webapp in Jetty -


i have webapp deploy on jetty server through jetty runner. inject properties read through properties file using spring. of now, have kept properties file within webapp (in web-inf/classes) directory. want keep properties file external webapp , inject them using spring. there configuration in jetty.xml file can can achieve this?

i managed solve adding properties file command line parameter while starting jetty. like:

java -dexternal.properties.file=myfile.properties -jar jetty.jar  

in java code, read getting system property , using fileutils file.

string externalpropertiesfile = system.getproperty("extern.properties.file"); file file = fileutils.getfile(externalpropertiesfile); 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -