Java 属性不是';在Spring上下文XML中解析t

Java 属性不是';在Spring上下文XML中解析t,java,spring,properties,javabeans,Java,Spring,Properties,Javabeans,我正在使用 return new ClassPathXmlApplicationContext("applicationContext.xml"); 在applicationContext.xml内部,我正在用 <bean id="dataSource" class="org.springframework.jdbc.datasource.SingleConnectionDataSource"> <property name="driverClassName

我正在使用

return new ClassPathXmlApplicationContext("applicationContext.xml");
applicationContext.xml内部,我正在用

<bean id="dataSource" 
    class="org.springframework.jdbc.datasource.SingleConnectionDataSource">
    <property name="driverClassName">
        <value>${db.driverclassname}</value>
    </property>
    ...
</bean>
我做错了什么?我用的是Spring 2.5.5,你不需要一个吗

e、 g


类路径:project.properties
详细说明使用方法。

您不需要一本吗

<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath:your.properties</value>
            </list>
        </property>
        <property name="ignoreUnresolvablePlaceholders" value="true"/>
    </bean>
e、 g


类路径:project.properties
详细说明用法。


<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath:your.properties</value>
            </list>
        </property>
        <property name="ignoreUnresolvablePlaceholders" value="true"/>
    </bean>
classpath:your.properties

classpath:your.properties
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath:your.properties</value>
            </list>
        </property>
        <property name="ignoreUnresolvablePlaceholders" value="true"/>
    </bean>