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