I’m having problem with handling multiple security context files. Let me describe what I’m trying to do:
I have my existing application which is running perfectly with my current spring security configuration. I’m trying to introduce another security mechanism that handle application security in different way. But I want to keep our existing security config as a backup and want to handle which one to use from a property file.
Say I have two spring security context files:
—-> applicationContext-security.xml
—-> applicationContext-security-new.xml
And I have a property something like this:
spring.config.use.new.config=true
So if the property file is true it will use the new context file. If something goes wrong I will just change the property file and can use existing security mechanism.
Is that possible? Any information will be highly appreciated. Looking forward for anyone’s answer 🙁
Thanks in advance.
What do you build your project with ?
If you use Maven you can just use the properties plugin and have it replace your config definitions in your web.xml.
Your web.xml would look something like:
Your pom.xml would have:
And your .properties file would have:
or