1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| package com.ycl.util;
|
| import org.springframework.context.ApplicationContext;
|
| public class SpringContextUtil {
| private static ApplicationContext ac;
|
| public static <T> T getBean(String beanName, Class<T> clazz) {
| T bean = ac.getBean(beanName, clazz);
| return bean;
| }
|
| public static void setAc(ApplicationContext applicationContext) {
| ac = applicationContext;
| }
|
| }
|
|