Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
未从java spring获取类路径中的属性文件_Java_Spring - Fatal编程技术网

未从java spring获取类路径中的属性文件

未从java spring获取类路径中的属性文件,java,spring,Java,Spring,我正在使用PropertyPlaceHolderConfigure从eclipse中的类路径访问属性文件 <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location"> <value>classpath :database.properties</value&g

我正在使用PropertyPlaceHolderConfigure从eclipse中的类路径访问属性文件

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">     
    <property name="location">
        <value>classpath :database.properties</value>
    </property>
</bean>
初始化xml错误时找不到database.properties文件。


<context:property-placeholder location="/WEB-INF/classes/*.properties" />

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">     
<property name="location">
    <value>${app.jdbc.username}</value>
    <value>${app.jdbc.password}</value>
</property>
</bean>
${app.jdbc.username} ${app.jdbc.password}
我不确定
类路径:
是否应该在那里?
<context:property-placeholder location="/WEB-INF/classes/*.properties" />

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">     
<property name="location">
    <value>${app.jdbc.username}</value>
    <value>${app.jdbc.password}</value>
</property>
</bean>