首先,main函數在類路徑下搜索到applicationContext.xml,類路徑即在src目錄下,我們在applicationContext.xml配置了id爲“performer”的bean,當加載applicationContext.xml是,spring容器會將performer初始化,之後就可以用容器找到想要的bean,然後調用它的方法。
首先,main函數在類路徑下搜索到applicationContext.xml,類路徑即在src目錄下,我們在applicationContext.xml配置了id爲“performer”的bean,當加載applicationContext.xml是,spring容器會將performer初始化,之後就可以用容器找到想要的bean,然後調用它的方法。
1、 2、 3、 4、 5、 6、 7、運行 HelloWorld 啓動後內置的Tomcat服務器也同時啓動起來了,然後在瀏覽器中輸入 localhost:8080/hello