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
Post a Comment