首页>代码>resteasy和spring整合开发restful风格接口的案例分享>/RESTfulExample/src/main/java/com/mkyong/context/SpringApplicationContext.java
package com.mkyong.context;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public class SpringApplicationContext implements ApplicationContextAware {

	private static ApplicationContext appContext;

    private SpringApplicationContext() {}
    
	@Override
	public void setApplicationContext(ApplicationContext applicationContext)
			throws BeansException {
		appContext = applicationContext;

	}

	public static Object getBean(String beanName) {
		return appContext.getBean(beanName);
	}

}
最近下载更多
浮生如茶  LV8 2024年11月19日
Lee帅力  LV5 2020年10月10日
172322564q  LV2 2019年12月25日
53722426  LV7 2019年10月10日
qiheideguang  LV18 2019年9月6日
kobekobe  LV2 2019年7月18日
z_yong76  LV26 2019年3月14日
起个名字真难aaaa  LV1 2018年11月16日
hanjinyu  LV11 2018年10月15日
yangyongxing  LV9 2018年7月22日
最近浏览更多
浮生如茶  LV8 2024年11月19日
baizhongcai  LV24 2024年5月30日
jelinna  LV2 2022年12月6日
aqin_qin  LV1 2022年6月5日
刘亦菲9527  LV15 2022年1月10日
1358849392  LV21 2022年1月7日
mylzdy  LV12 2021年8月26日
tianli3000  LV8 2021年7月27日
鸦葱  LV4 2021年6月11日
shiopaaa  LV13 2021年4月19日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友