Spring 自定义配置类bean

时间:2022-09-20 20:36:15
 <!-- 引入配置文件 -->
    <bean id="propertyConfigurer"  
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">  
        <property name="locations">
            <list>
                <value>classpath:resources/jdbc.properties</value>  <!--jdbc的配置文件-->
                <value>classpath:resources/QRCodeProperties.properties</value>  <!--自定义的配置文件-->
            </list>
        </property>  
    </bean> 
    
    <!-- 自定义配置类bean --> 
       <bean id="woaConfigure" class="com.ink.utils.WOAProperties">
           <property name="QRCodeDictory" value="${QRCodeDictory}" /> 
           <property name="QRCodeHeight" value="${QRCodeHeight}" />
           <property name="QRCodePicFormat" value="${QRCodePicFormat}" />
           <property name="QRCodePrefix"  value="${QRCodePrefix}"/>
           <property name="QRCodeWidth" value="${QRCodeWidth}" />
           <property name="QRCodeTempDictory" value="${QRCodeTempDictory}" />
       </bean>