SPEL(Spring Experssion Language)Spring表达式语言

<?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.or.g/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd">
<bean class="Test.Book" id="book">
<property name="bookName" value="西游记"></property>
</bean>
<bean class="Test.Person" id="person01">
<!-- 一:使用字面量,支持所有运算符 -->
<property name="age" value="#{123*6}"></property>
<!-- 二:引用其他bean的某个属性值 -->
<property name="name" value="#{book.bookName}"></property>
<!-- 三:引用其他的bean -->
<property name="myCar" value="#{car}"></property>


<!-- 调用静态方法和非静态方法 -->
<!-- 静态方法模板:#{T(全类名).静态方法名(1,2)} -->
<property name="email" value="#{T(java.util.UUID).randomUUID().toString().substring(0,5)}"></property>
<!-- 调用非静态方法 对象.方法名-->
<property name="grade" value="#{book.getBookName()}"></property>

</bean>
</beans>