Support for environment/JVM -D placeholders in Spring app context XML/web.xml files

Answered

We are using placeholders in web.xml and spring's application context xml files for example when starting tomcat

application we pass -Dcache.enabled=on or -Dcache.enabled=off, inside of applicationContext.xml we have 

<import resource="cache-${cache.enabled:off}.xml" /> so it will import cache-on.xml or cache-off.xml depending on the -D JVM parameter, and if it doesn't exist it will fall back to cache-off.xml. Intellij Idea always marks lines like this with an error. Is there a way to tell IDE resolve this somehow to a correct file includes so that Spring application map of dependencies is build properly?  

If anyone has a more or less working solution for this it will be great if you can share your setup.

Thanks!

0

Please sign in to leave a comment.