I'm currently using Spring @Profile
to manage my web application's configuration based on the environment (DEV, TEST, PROD). In order to activate the right profile, I prefer not to hardcode the value for spring.profiles.active
in web.xml
. Rather, I want to rely on the JNDI from the server to determine the right profile to activate. I'm able to get this working by creating a JNDI string called spring.profiles.active
with the value, say DEV, to activate the DEV profile in my web application.
The problem is my server environment already has a custom JNDI ( say, bla/environment
) that contains the value DEV, TEST or PROD.
Is it possible to set spring.profiles.active
based on this custom JNDI so that I don't have to create another JNDI that does the same thing?
Thank you.