SpEL
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id = "address" class="cn.zzuli.spring.beans.spel.Address">
<!-- SpEL字面值 -->
<property name="city" value="#{'beijing'}"></property>
<property name="street" value="wudaokou"></property>
</bean>
<bean id="car" class="cn.zzuli.spring.beans.spel.Car">
<!-- SpEL类的静态属性 -->
<property name="brand" value="Audi"></property>
<property name="price" value="400000"></property>
<property name="tyrePerimeter" value="#{T(java.lang.Math).PI * 80}"></property>
</bean>
<bean id="person" class="cn.zzuli.spring.beans.spel.Person">
<property name="name" value="song"></property>
<!-- SePL引用其他bean -->
<property name="car" value="#{car}"></property>
<!-- SePL引用其他bean的属性 -->
<property name="city" value="#{address.city}"></property>
<!-- SePL引用其他运算符 ,动态赋值-->
<property name="info" value="#{car.price > 300000 ? '金领' : '白领'}"></property>
</bean>
</beans>