ApplicationContext context=ContextLoader.getCurrentWebApplicationContext();
當(dāng)Spring啟動起來后,取得上下文可以如此處理,上述代碼適宜放在靜態(tài)構(gòu)造子中,然后將值傳給一個靜態(tài)變量。
當(dāng)柳上原的風(fēng)吹向天際的時候...真正的快樂來源于創(chuàng)造 |
ApplicationContext context=ContextLoader.getCurrentWebApplicationContext(); 當(dāng)Spring啟動起來后,取得上下文可以如此處理,上述代碼適宜放在靜態(tài)構(gòu)造子中,然后將值傳給一個靜態(tài)變量。 |