<?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="myPerson" class="com.gqc.di09.Person">
<property name="pname" value="李四" />
<property name="page" value="#{T(java.lang.Math).random()*50}"/>
</bean>
<!-- 注册Student
-->
<bean id="myStudent" class="com.gqc.di09.Student" autowire="byType">
<property name="name" value="#{myPerson.pname}"/><!-- 要有get方法-->
<!-- <property name="age" value="#{myPerson.page>25?25:myPerson.page}" /> -->
<property name="age" value="#{myPerson.computeAge()}" />
</bean>
</beans>