Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 128859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:42:06+00:00 2026-05-11T05:42:06+00:00

The solution to this is probably very simple, but I’m not sure what I’m

  • 0

The solution to this is probably very simple, but I’m not sure what I’m missing. Here’s what I have, and PropertyPlaceholderConfigurer won’t replace the ${...}.

/* ---- org/company/springtest/Test.java: ---- */ package org.company.springtest;  import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource;  public class Test {     public static void main( String... args ) {          Resource res = new FileSystemResource('conf/xml/context2.xml');              XmlBeanFactory beanFactory = new XmlBeanFactory(res);              TestApp app = (TestApp) beanFactory.getBean('testApp');              app.print();     }    }   /* ---- org/company/springtest/TestApp.java: ---- */ package org.company.springtest; import org.springframework.beans.factory.annotation.Required;  public class TestApp {     private String m_message;      public void setMessage( String message ) {          m_message = message;     }      public void print() {         System.out.println(m_message);     } }  /* ---- conf/xml/context2.xml: ---- */ <?xml version='1.0' encoding='UTF-8'?> <beans xmlns='http://www.springframework.org/schema/beans'  xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:lang='http://www.springframework.org/schema/lang' xsi:schemaLocation=' http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd'>      <bean class='org.springframework.beans.factory.config.PropertyPlaceholderConfigurer'>         <property name='locations' value='file:conf/xml/test.properties' />     </bean>     <bean id='testApp' class='org.company.springtest.TestApp'>          <property name='message' value='${test.message}'/>     </bean> </beans>  /* ---- conf/xml/test.properties: ---- */ test.message=Hello world! 

The following is the output when running Test:

Feb 17, 2009 11:23:06 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from file [C:\eclipse\workspace\SpringTest\conf\xml\context2.xml] ${test.message} 

It looks like the Configurer is not replacing the property values…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:42:07+00:00Added an answer on May 11, 2026 at 5:42 am

    Perhaps try using an ApplicationContext instead of a BeanFactory?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

there's probably a very simple solution but I'm at my wit's end here. I
This is probably a simple question but I can't seem to find the solution.
I'm aware this is probably a very simple problem with a 1-line-of-code answer but
This is probably easy but I am getting stuck: when I build a solution
This is probably a no brainer but... I've just opened a solution in VS2008
This is probably the most classic database problem. I have an E-commerce software solution
I'm new with Objective-C, so there probably is a simple solution to this. I
I think I have a solution to this, but is there a better way,
I have this solution for a single button: myButton.Attributes.Add(onclick, this.disabled=true; + GetPostBackEventReference(myButton).ToString()); Which works
I found this solution which works, but I find it hard to believe there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.