工具类-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 }

 

posted @ 2019-11-07 21:10  _万古如长夜  阅读(1504)  评论(0编辑  收藏  举报