Results 1 to 2 of 2

Thread: How to add another Property connfiguration

  1. #1

    Question How to add another Property connfiguration

    Hi,

    I'm creating a spring project which have dependency with another project.
    There's already a PreferencesPlaceholderConfigurer in the dependency project application context.

    Is it possible to add a properties file without a need to alter the dependency project?


    Here is my application context look like
    ProjectA is my dependency and Project B is the one I'm currently creating.

    ProjectA application context
    ...
    Code:
    <bean id="projectAconfig" class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer">
       <property name="locations">
            <list>
                <value>file:C/ProjectA/config/config.properties</value>
            </list>
        </property>
    </bean>
    config.properties
    Code:
    db.username=s
    ProjectB application context (where I would like to add another property file
    Code:
    <import resource="file:C:/projectA/application-context.xml"/>
    
    <bean id="projectBconfig" class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer">
       <property name="locations">
            <list>
                <value>file:C/ProjectB/config/configB.properties</value>
            </list>
        </property>
    </bean>
    configB.properties
    Code:
    myFont=Arial
    I have tried this way, but it throws an error said it cannot resolve placeholder.

    Can anyone show me how this can be done.

    Thanks.

  2. #2

    Default

    what exactly error did you get? Can you post the stack trace?

Tags for this Thread

Posting Permissions

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