工具类-ApplicationContextUtil


 1 package com.zhouyy.netBank.util;
 2 
 3 import org.springframework.beans.BeansException;
 4 import org.springframework.context.ApplicationContext;
 5 import org.springframework.context.ApplicationContextAware;
 6 
 7 public class ApplicationContextUtil implements ApplicationContextAware {
 8 
 9     private static ApplicationContext context;
10 
11 
12     public void setApplicationContext(ApplicationContext context) throws BeansException {
13         this.context = context;
14     }
15 
16     public static ApplicationContext getContext() {
17         return context;
18     }
19 }