Wildfly access file in standalone/lib

438 views Asked by At

i´m currently writing a web-application, which shall fetch some websites, crawl them for information and send these informations to my email.

Now i´m thinking about, how to make the application configurable. I don´t want to set my email-adress in the code.

My thought is, to store a config.xml file in the wildfly standalone/lib folder and then accessing this easily in the code? Would this be possible, or have you nicer solutions?

1

There are 1 answers

2
KgaboL On

You can add it to your standalone.xml under <system-properties>

<property name="my.email.address" value="[email protected]"/>

and in your code get it with:

String emailAddress = System.getProperty("my.email.address");