<?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:p="http://www.springframework.org/schema/p"
xmlns:util="http://http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/util
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"
default-init-method=""
default-destroy-method=""
default-autowire="byType"> <!-- 默认自动装配方式 -->
<util:list id="strArray">
<value>Hello</value>
<value>Welcome</value>
</util:list>
<bean id="duke" class="Juggler" > <constructor-arg value="10"/> </bean>
<bean id="sonnet29" class="Sonnet29" />
<bean id="poeticDuke" class="PoeticJuggler" >
<constructor-arg value="10"/>
<constructor-arg ref="sonnet29"/>
</bean>
<bean id="theStage" class="Stage" factory-method="getInstance"></bean>
<bean id="sonnt29" class="Sonnet29" scope="prototype" /> <!-- 每次请求产生一个新的实例 -->
<bean id="sonnt292" class="Sonnet29" scope="singleton" > <!-- 默认的 只有一个实例 -->
<property name="" value="#{systemEnvironment['HOME']}" /><!-- 系统环境 -->
<property name="bigCites" value="#{cities.?[population gt 10000]}" /><!-- .?[] 查询运算符 .^[]第一个匹配项 .$[] 最后一个 -->
<property name="bigCites" value="#{cities.![name]}" /><!-- .![] 投影操作 -->
<property name="" value="#{theStage.song}" />
<property name="" value="#{theStage.selectSong()}" />
<property name="" value="#{theStage.selectSong()?.toUpperCase()}" /><!-- null safe -->
<property name="" value="#{T(java.lang.Math).PI}" />
<property name="" value="#{T(java.lang.Math).random() + 20}" />
<property name="validV" value="#{ value matches '[a-z+]'}" />
<property name="validV" value="#{strArray[2] }" />
<property name="" ><null/></property>
<property name="" ref="" />
<property name="" >
<bean class="" />
</property>
<property name="l1">
<list>
<ref bean=''/>
<ref bean=''/>
</list>
</property>
<property name="l2">
<set>
<ref bean=''/>
<ref bean=''/>
</set>
</property>
<property name="l3">
<map>
<entry key='str' value-ref="bean"/>
<entry key='str' value="str"/>
<entry key-ref='bean' value="str"/>
<entry key-ref='bean' value-ref="bean"/>
</map>
</property>
<property name="l4">
<props>
<prop key='str'>str</prop>
</props>
</property>
</bean>
<bean id="s1" class="S1" init-method="" destroy-method=""/>
<util:properties id="settings" location="classpath:settings.properties"/><!-- 加载一个配置文件到settins props -->
<property name='' value='#{settings['key']}'/>
<!-- 将多个配置文件读取到容器中,交给Spring管理 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<!-- 这里支持多种寻址方式:classpath和file -->
<value>classpath:/opt/demo/config/demo-db.properties</value>
<!-- 推荐使用file的方式引入,这样可以将配置和代码分离 -->
<value>file:/opt/demo/config/demo-mq.properties</value>
<value>file:/opt/demo/config/demo-remote.properties</value>
</list>
</property>
</bean>
<!-- 使用MQ中的配置 -->
<bean id="MQJndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">${mq.java.naming.factory.initial}</prop>
</props>
</property>
</bean>
<!-- 自动装配 -->
<bean id="MQJndiTemplate" class="org.springframework.jndi.JndiTemplate" autowire="byName"/>
<bean id="MQJndiTemplate" class="" primary="false"/>
<bean id="MQJndiTemplate" class="" autowire-candidate="false"/>
</beans>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/util
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"
default-init-method=""
default-destroy-method=""
default-autowire="byType"> <!-- 默认自动装配方式 -->
<util:list id="strArray">
<value>Hello</value>
<value>Welcome</value>
</util:list>
<bean id="duke" class="Juggler" > <constructor-arg value="10"/> </bean>
<bean id="sonnet29" class="Sonnet29" />
<bean id="poeticDuke" class="PoeticJuggler" >
<constructor-arg value="10"/>
<constructor-arg ref="sonnet29"/>
</bean>
<bean id="theStage" class="Stage" factory-method="getInstance"></bean>
<bean id="sonnt29" class="Sonnet29" scope="prototype" /> <!-- 每次请求产生一个新的实例 -->
<bean id="sonnt292" class="Sonnet29" scope="singleton" > <!-- 默认的 只有一个实例 -->
<property name="" value="#{systemEnvironment['HOME']}" /><!-- 系统环境 -->
<property name="bigCites" value="#{cities.?[population gt 10000]}" /><!-- .?[] 查询运算符 .^[]第一个匹配项 .$[] 最后一个 -->
<property name="bigCites" value="#{cities.![name]}" /><!-- .![] 投影操作 -->
<property name="" value="#{theStage.song}" />
<property name="" value="#{theStage.selectSong()}" />
<property name="" value="#{theStage.selectSong()?.toUpperCase()}" /><!-- null safe -->
<property name="" value="#{T(java.lang.Math).PI}" />
<property name="" value="#{T(java.lang.Math).random() + 20}" />
<property name="validV" value="#{ value matches '[a-z+]'}" />
<property name="validV" value="#{strArray[2] }" />
<property name="" ><null/></property>
<property name="" ref="" />
<property name="" >
<bean class="" />
</property>
<property name="l1">
<list>
<ref bean=''/>
<ref bean=''/>
</list>
</property>
<property name="l2">
<set>
<ref bean=''/>
<ref bean=''/>
</set>
</property>
<property name="l3">
<map>
<entry key='str' value-ref="bean"/>
<entry key='str' value="str"/>
<entry key-ref='bean' value="str"/>
<entry key-ref='bean' value-ref="bean"/>
</map>
</property>
<property name="l4">
<props>
<prop key='str'>str</prop>
</props>
</property>
</bean>
<bean id="s1" class="S1" init-method="" destroy-method=""/>
<util:properties id="settings" location="classpath:settings.properties"/><!-- 加载一个配置文件到settins props -->
<property name='' value='#{settings['key']}'/>
<!-- 将多个配置文件读取到容器中,交给Spring管理 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<!-- 这里支持多种寻址方式:classpath和file -->
<value>classpath:/opt/demo/config/demo-db.properties</value>
<!-- 推荐使用file的方式引入,这样可以将配置和代码分离 -->
<value>file:/opt/demo/config/demo-mq.properties</value>
<value>file:/opt/demo/config/demo-remote.properties</value>
</list>
</property>
</bean>
<!-- 使用MQ中的配置 -->
<bean id="MQJndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">${mq.java.naming.factory.initial}</prop>
</props>
</property>
</bean>
<!-- 自动装配 -->
<bean id="MQJndiTemplate" class="org.springframework.jndi.JndiTemplate" autowire="byName"/>
<bean id="MQJndiTemplate" class="" primary="false"/>
<bean id="MQJndiTemplate" class="" autowire-candidate="false"/>
</beans>