<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 303  文章 - 883  trackbacks - 0
    <2007年9月>
    2627282930311
    2345678
    9101112131415
    16171819202122
    23242526272829
    30123456

    歡迎光臨! 
    閑聊 QQ:1074961813

    隨筆分類(357)

    我管理的群

    公共blog

    • n維空間
    • Email : java3d@126.com 群 : 12999758

    參與管理的論壇

    好友的blog

    我的其他blog

    朋友的網站

    搜索

    •  

    最新評論

    對于前個一代碼這個代碼加<ref bean=""/>使用和一些調試的System.out.println()從中你可以看到spring2.0的執行過程

    /src/applicationContext.xml
    <?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-2.0.xsd">

        
    <bean id="strvalue" class="com.lusm.spring.test.StrValue">
            
    <property name="str">
                
    <value>再見了!!!</value>
            
    </property>       
        
    </bean>

        
    <bean id="hello" class="com.lusm.spring.test.Hello" abstract="false"
            lazy-init
    ="default" autowire="default" dependency-check="default">
            
    <property name="str">
                
    <value>你好啊!!!</value>
            
    </property>
            
    <property name="sv">
                
    <ref bean="strvalue" />
            
    </property>
        
    </bean>

    </beans>

    /src/com/lusm/spring/test/StrValue.java

    package com.lusm.spring.test;

    public class StrValue {
        
        String str;
        
        StrValue()
    {
            System.out.println(
    "StrValue class is builded");
        }

        
        
    public void SayGY(){
            System.out.println(str);
        }


        
    public String getStr() {
            
    return str;
        }


        
    public void setStr(String str) {
            
    this.str = str;
        }

    }

    /src/com/lusm/spring/test/Hello.java

    package com.lusm.spring.test;

    public class Hello {
        
    private String str;
        
    private StrValue sv;

        
    public String getStr() {
            System.out.println(
    "getStr");
            
    return str;
        }


        
    public void setStr(String str) {
            System.out.println(
    "setStr");
            
    this.str = str;
        }


        
    public void sayHello() {
            System.out.println(str);
        }


        
    public StrValue getSv() {
            System.out.println(
    "getSv");
            
    return sv;
        }


        
    public void setSv(StrValue sv) {
            System.out.println(
    "setSv");
            
    this.sv = sv;
        }


    }

    /src/com/lusm/spring/test/HelloTest.java

    package com.lusm.spring.test;

    import org.springframework.context.ApplicationContext;
    import org.springframework.context.support.FileSystemXmlApplicationContext;

    public class HelloTest {

        
    public static void main(String[] args) {
            ApplicationContext ac 
    = new FileSystemXmlApplicationContext(
                    
    "/src/applicationContext.xml");

            Hello h 
    = (Hello) ac.getBean("hello");

            System.out.println(h.getStr());
            h.sayHello();

            StrValue sv 
    = h.getSv();
            sv.SayGY();
        }


    }

    執行結果

    log4j:WARN No appenders could be found for logger (org.springframework.context.support.FileSystemXmlApplicationContext).
    log4j:WARN Please initialize the log4j system properly.

    StrValue 
    class is builded
    setStr
    setSv
    getStr
    你好啊!!!
    你好啊!!!
    getSv
    再見了!!!




    地震讓大伙知道:居安思危,才是生存之道。
    posted on 2007-09-13 23:00 小尋 閱讀(416) 評論(0)  編輯  收藏 所屬分類: j2se/j2ee/j2me
    主站蜘蛛池模板: 亚洲欧美日韩综合久久久久 | 亚洲成年人电影网站| 亚洲AV无码一区二区乱子伦 | 成人av片无码免费天天看| 永久免费无码网站在线观看| 日本高清不卡中文字幕免费| 亚洲av最新在线网址| 一个人免费高清在线观看| 黄页网站在线观看免费| 亚洲成AV人片在线观看无| 99久久免费国产精品特黄| 一级毛片高清免费播放| 亚洲高清中文字幕综合网| 国产一区二区三区在线免费| 少妇人妻偷人精品免费视频| 亚洲成a人片在线观看无码| 欧美三级在线电影免费| 国产成人无码免费网站| 亚洲二区在线视频| 亚洲伊人成无码综合网| 成全影视免费观看大全二| 你懂的免费在线观看| 亚洲av丰满熟妇在线播放| 成熟女人牲交片免费观看视频| 日韩免费高清播放器| 无码色偷偷亚洲国内自拍| 亚洲视频在线不卡| 国产亚洲精品拍拍拍拍拍| 精品剧情v国产在免费线观看| 免费人成在线观看网站| 特级aa**毛片免费观看| 亚洲一级毛片在线播放| 亚洲AV无码久久精品蜜桃| 免费在线观看你懂的| 免费看的成人yellow视频| 97免费人妻在线视频| 国产无限免费观看黄网站| 亚洲av乱码一区二区三区按摩| 亚洲国产电影在线观看| 亚洲AV无码不卡无码| 国产亚洲精品自在线观看|