锘??xml version="1.0" encoding="utf-8" standalone="yes"?>中文字幕免费国产精品,久久99久久99精品免视看婷婷,国产激情一区二区三区在线观看http://www.aygfsteel.com/human2008/category/28901.htmlzh-cnFri, 11 Jan 2008 07:42:15 GMTFri, 11 Jan 2008 07:42:15 GMT60Java 錛嶏紞 鍦‥clipse涓婁嬌鐢⊿pring http://www.aygfsteel.com/human2008/archive/2008/01/11/174495.html鐏?鐏?Fri, 11 Jan 2008 01:33:00 GMThttp://www.aygfsteel.com/human2008/archive/2008/01/11/174495.htmlhttp://www.aygfsteel.com/human2008/comments/174495.htmlhttp://www.aygfsteel.com/human2008/archive/2008/01/11/174495.html#Feedback0http://www.aygfsteel.com/human2008/comments/commentRss/174495.htmlhttp://www.aygfsteel.com/human2008/services/trackbacks/174495.html涓婁竴綃囨枃绔?/a>浠嬬粛浜嗗浣曞湪Eclipse涓婁嬌鐢℉ibernate鐨勫叆闂紝鏈枃灝辯畝鍗曚粙緇嶄竴涓嬪浣曞湪Eclipse浣跨敤Spring銆?br />
    錛?錛夐鍏堬紝鏄笅杞絊pring錛屽彲浠ヤ粠sourceforge涓婁笅杞斤紝http://sourceforge.net/projects/springframework銆傜洰鍓嶇殑鏈鏂扮殑鍙互涓嬭澆 spring-framework-1.2.8-with-dependencies.zip 銆?br />
    錛?錛夌劧鍚庯紝鍙互灝哠pring寮曞叆鍒頒綘鐨勯」鐩腑銆?br />     鍏堝皢spring-framework-1.2.8-with-dependencies.zip瑙e帇錛屽皢鍏朵腑鐨剆pring.jar錛坉ist鐩綍涓級銆乧ommons-logging.jar錛坙ib\jakarta-commons鐩綍錛夈乴og4j-1.2.13.jar錛坙ib\log4j鐩綍錛夎繖涓変釜鏂囦歡澶嶅埗鍒扮殑”D:\java\Spring\lib" 鐩綍涓紝鐒跺悗鍦‥clipse涓緩绔嬩竴涓?#8220;Spring”搴擄紝灝嗛偅涓変釜鏂囦歡娣誨姞榪?#8220;Spring”搴撲腑銆?br />
    錛?錛夋祴璇曚竴涓嬶細
    鏂板緩涓や釜綾伙紝Student鍜孊ook銆?br />
public class Book 
{
    
private int id = 0 ;
    
private String bookName ;
    
public String getBookName() {
        
return bookName;
    }
    
public void setBookName(String bookName) {
        
this.bookName = bookName;
    }
    
public int getId() {
        
return id;
    }
    
public void setId(int id) {
        
this.id = id;
    }
}

public class Student 
{
    
private int age = 0;    
    
private String name ;
    
private Book book ;

    
public int getAge() {
        
return age;
    }

    
public void setAge(int age) {
        
this.age = age;
    }
    
    
public String getName() {
        
return name;
    }

    
public void setName(String name) {
        
this.name = name;
    }

    
public Book getBook() {
        
return book;
    }

    
public void setBook(Book book) {
        
this.book = book;
    }
    
    
public String GetBookName()
    {
        
return this.book.getBookName() ;
    }    
}

    鐒跺悗娣誨姞Spring閰嶇疆鏂囦歡bean.xml錛坆ean.xml蹇呴』鍦–LASSPATH鍙互瀛樺彇鍒扮殑鐩綍涓級錛?br />
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING/DTD BEAN/EN" 
"http://www.springframework.org/dtd/spring-beans.dtd">

<beans>
    
<bean id="student" class="com.springTest.Student">
        
<property name="age">
            
<value>22</value>
        
</property>
        
<property name="name">
            
<value>Sky</value>
        
</property>
        
<property name="book" ref="book">            
        
</property>
    
</bean>
    
    
<bean id="book" class="com.springTest.Book">
         
<property name="id">
            
<value>1000</value>
        
</property>
        
<property name="bookName">
            
<value>鎴樹簤涓庡拰騫?/span></value>
        
</property>
    
</bean>
</beans>

    鏈鍚庣殑涓葷▼搴忥細
    public static void main(String[] args) 
    {
        Resource res 
= new ClassPathResource("bean.xml");
        BeanFactory factory 
= new XmlBeanFactory(res);

        Student stu 
= (Student) factory.getBean("student");
        System.
out.println(stu.GetBookName());
    }
    榪愯鍚庡彲浠ョ湅鍒版帶鍒跺彴杈撳嚭錛嶏紞“鎴樹簤涓庡拰騫?#8221;銆?br />
    涓嶴pring.net鐨勪嬌鐢ㄥ熀鏈畬鍏ㄤ竴鑷達紙鍖呮嫭閰嶇疆鏂囦歡銆丅eanFactory鐨勮幏鍙栫瓑錛夛紝鎵浠ョ啛鎮塖pring.net鐨勪綘榪囨浮鍒癝pring鏄潪甯稿鉤婊戠殑銆?br />     鏈鍚庯紝Java涓殑灞炴у疄鍦ㄦ槸娌℃湁C#涓殑綆媧侊紝鍛靛懙銆?br />

鐏? 2008-01-11 09:33 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 金塔县| 江油市| 正蓝旗| 汤原县| 通辽市| 得荣县| 津南区| 英吉沙县| 科技| 兴海县| 城固县| 曲水县| 鹤峰县| 济宁市| 辽宁省| 金川县| 龙口市| 格尔木市| 霍邱县| 石景山区| 延津县| 花莲县| 兴安县| 高清| 平阳县| 新营市| 曲阳县| 乌拉特后旗| 台东县| 离岛区| 新巴尔虎右旗| 临夏县| 武川县| 怀安县| 盘山县| 迁安市| 清涧县| 三门峡市| 壤塘县| 高密市| 卓资县|