首页>代码>ssm(Spring + Mybatis + SpringMVC) +redis开发网站用户权限后台管理系统>/permission/src/main/Java/com/mall/common/ApplicationContextHelper.java
package com.mall.common; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.stereotype.Component; @Component("applicationContextHelper") public class ApplicationContextHelper implements ApplicationContextAware { private static ApplicationContext applicationContext; public void setApplicationContext(ApplicationContext context) throws BeansException { applicationContext = context; } public static <T> T popBean(Class<T> clazz) { if (applicationContext == null) { return null; } return applicationContext.getBean(clazz); } public static <T> T popBean(String name, Class<T> clazz) { if (applicationContext == null) { return null; } return applicationContext.getBean(name, clazz); } }
最近下载更多
xuweiwowzy LV5
2月24日
yyh1252 LV8
2023年12月9日
wuying8208 LV15
2023年11月25日
luoyongbing LV8
2023年3月30日
hbsoft2008 LV16
2022年11月18日
wz520135 LV7
2022年11月5日
qq1466625431 LV6
2022年6月28日
实验高中道锅 LV2
2022年4月14日
Jason137 LV8
2022年3月15日
wanglinddad LV53
2022年3月14日
最近浏览更多
xuweiwowzy LV5
1月14日
minjing123 LV8
1月4日
WBelong LV6
2023年12月27日
yyh1252 LV8
2023年12月9日
maoxp-1 LV2
2023年11月30日
wuying8208 LV15
2023年11月25日
13188866605 LV12
2023年10月22日
oulingqiao LV13
2023年10月17日
1997akkk LV5
2023年8月8日
c469893928 LV2
2023年6月10日