Java 带有bean名称的常量错误
最近我决定和春天一起玩。我做了一些教程,在我尝试使用多个属性文件之前,一切似乎都很好。正如互联网所说,做这样的事情就足够了Java 带有bean名称的常量错误,java,xml,spring,property-placeholder,Java,Xml,Spring,Property Placeholder,最近我决定和春天一起玩。我做了一些教程,在我尝试使用多个属性文件之前,一切似乎都很好。正如互联网所说,做这样的事情就足够了 <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="ignoreUnresolvablePlaceholders" value="true"/> <proper
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="ignoreUnresolvablePlaceholders" value="true"/>
<property name="ignoreResourceNotFound" value="true"/>
<property name="location">
<list>
<value>classpath:readData.properties</value>
<value>classpath:sendMail.properties</value>
</list>
</property>
</bean>
可以使用“上下文:特性占位符”标记指定多个特性文件 例如:
<context:property-placeholder location="readData.properties,
sendMail.properties"/>
不要忘记向bean标记添加上下文模式,如下所示:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd>
可以使用context:property占位符标记指定多个属性文件
例如:
<context:property-placeholder location="readData.properties,
sendMail.properties"/>
不要忘记向bean标记添加上下文模式,如下所示:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd>
可以使用context:property占位符标记指定多个属性文件
例如:
<context:property-placeholder location="readData.properties,
sendMail.properties"/>
不要忘记向bean标记添加上下文模式,如下所示:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd>
可以使用context:property占位符标记指定多个属性文件
例如:
<context:property-placeholder location="readData.properties,
sendMail.properties"/>
不要忘记向bean标记添加上下文模式,如下所示:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd>
如果要使用多个属性文件,请使用“位置”而不是“位置”。对于单个属性,可以使用“位置”
检查api文档:
如果要使用多个属性文件,请使用“位置”而不是“位置”。对于单个属性,可以使用“位置”
检查api文档:
如果要使用多个属性文件,请使用“位置”而不是“位置”。对于单个属性,可以使用“位置”
检查api文档:
如果要使用多个属性文件,请使用“位置”而不是“位置”。对于单个属性,可以使用“位置”
检查api文档: