spring04

今天设计到的内容是是spring的sqel和ioc的生命周期和bean的后置处理器

具体的测试文件如下:

<?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="lib3.Address">
         使用spel为属性赋一个字面值
    <property name="city" value="cjbdiscsa"></property>
    <property name="street" value="#{'sahcjwdn'}"></property>
    </bean> 
    <bean id="Car" xmlns="default namespace">
    <property name="braca" value="saccas"></property>
    <property name="cbajsbc" value="299"></property>
         使用sqel引用类的静态属性
    <property name="scskjvdbsi" value="#{T(java.lang.Math).PI*80}"></property>
    </bean>
    <bean id="person" class="libxas">
     使用sqel引用其他的bean
    <property name="car" value="#{car}"></property>
   使用sqel来引用其他bean的属性
    <property name="city" value="#{address.city}"></property>
     在sqel中使用运算符
    <property name="info" value="#{car.prece>2000?'jine':'bailing'}"></property>
    <property name="name" value="tom"></property>
    </bean>
    五部生命周期的流程的测试
    <bean id="car" class="scaacs"   
   init-method="init" 
   destroy-method="destory">
    <property name="borad" value="ckds"></property>
    </bean>-->
</beans>

在init的前后来执行相应的操作..

可以偷梁换柱

原文地址:https://www.cnblogs.com/dazhi151/p/12616358.html