How to pull values from properties file into persistence.xml and context.xml?

27 views Asked by At

I have an app with Java 17, Tomcat 10.

I would like to use a properties file (or its variation) so I can read it from different sides of my code or from my persistence.xml and context.xml files.

What have I tried?

I created a properties file and imported it into a listener. I also managed it by putting in the catalina.properties a app.profile=profile

This worked in a Java class, but for the context.xml and persistence.xml it doesn't read the properties.

I have created profiles in the pom.xml with the properties. But in the persistence.xml and context.xml I can't extract the properties. I followed advice from here.

0

There are 0 answers