Results 1 to 5 of 5

Thread: Does spring support placeholder in <import>

  1. #1
    Join Date
    May 2008
    Posts
    2

    Default Does spring support placeholder in <import>

    Hi

    I am wondering if I can do
    <import resource="${spring-file}"/>

    I tried but it seem that spring does not do the replacement

  2. #2
    Join Date
    Jun 2008
    Posts
    3

    Default

    Same trouble here! Any directions?

    Rgrds,
    JV -- julioviegas.com

  3. #3
    Join Date
    Jun 2008
    Posts
    3

    Default

    Mistery solved! DefaultBeanDefinitionDocumentReader.importBeanDefi nitionResource(from code that read xml into bean definitions) uses SystemPropertyUtils.resolvePlaceHolders instead of PropertyPlaceholderConfigurer. I think PropertyPlaceholderConfigurer was not designed to replace placeholders in import elements. Anyway, you can set the placeholder value in a -D java argument or in a environment variable, and voila!

    Should I file a JIRA enhancement?

    Att,
    JV -- julioviegas.com

  4. #4
    Join Date
    May 2005
    Location
    San Diego, CA
    Posts
    76

    Default

    Another way you can do this is use ant to replace the placeholder during build time. Its good to know that you can also do it through the commandline. I would think this would be nice enhancement to have.
    Last edited by umeshajb; Jun 24th, 2008 at 02:29 PM.

  5. #5
    Join Date
    Jun 2008
    Posts
    3

    Default

    My environment does not depends upon ant, so for me it isn't an option...

    Rgrds,
    JV -- julioviegas.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •