1. Marsha

    Thanks. I’ve been using the “straightforward” import method and have been uneasy about it the whole time though I couldn’t pinpoint why (the import method has done well for us so far but probably because our webapp is small right now) . Your post gives me some things to think about and redesign before we grow the webapp and get stuck in an import dilemma.

  2. I’ve tried this technique with success, with the parent being an “EJB” (jar) and child being a war. Where I got stuck however is when it came to the need for the resource-ref’ed datasource defined in the war being usable by the EJB.

  3. rkb

    This is brilliant idea, but doesot work for scenario below.

    So you load the PropertyPlaceholderConfigurer context xml at the parentRootContext.

    These properties are not available to the application context that are not part of the parentRootContext, in case of multiple context roots.

    • PropertyPlaceholderConfigurer only works for a single applicationContext layer, this could be useful for some scenarios and unuseful for others.

  4. kmc

    How would you apply this solution when not using Spring application context XMLs and instead use AnnotationConfigWebApplicationContext coupled with ApplicationContextInitializer?

Leave a Reply

Your email address will not be published. Required fields are marked *