Sample project which shows how to inject properties into Java EE applications
Java
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/main
.gitignore
README.md
pom.xml

README.md

Injecting properties in Java EE applications

Run with a Java EE compliant application server

You have to deploy the war-file manually. You can generate the war-file by typing on the command line:

mvn clean compile package

Now you will find the war-file in the target directory of the project.

Drop it into your favorite Java EE compliant application server and you're ready to test it.

While deploying the application you should see some log messages in the log file of your application server:

==Starting application==
Found configuration config.properties:
Key: serverIp value: 192.168.0.1
Key: serverName value: JEE Sample
Found configuration other.properties:
Key: A value: 123456
Key: C value: 456789
Key: B value: 789123

You can also access a basic servlet which will print out the properties of config.properties file at http://localhost:8080/javaee-classpath-properties/