普通的java工程(非web)怎么使用spring框架
1 回答

達(dá)令說
TA貢獻(xiàn)1821條經(jīng)驗(yàn) 獲得超6個贊
應(yīng)用上下文
應(yīng)用上下文提供更多的功能,包括資源獲取、國際化,事件處理等等。對于有單例要求的實(shí)例,在加載的時候就已經(jīng)實(shí)例化。
org.springframework.context.support.ClassPathXmlApplicationContext
ApplicationContext實(shí)現(xiàn),它可以依據(jù)Classpath查找配置文件
ApplicationContext ctx = new ClassPathXmlApplicationContext(配置文件的CLASSPATH路徑)
其它實(shí)現(xiàn):XmlWebApplicationContext,F(xiàn)ileSystemXmlApplicationContext
不好意思沒時間說的更詳細(xì)了,其實(shí)都是一樣的,最終都是如何獲得“應(yīng)用上下文”。
- 1 回答
- 0 關(guān)注
- 1579 瀏覽
添加回答
舉報
0/150
提交
取消