package com.core.utils;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
* 因为webscoket类中无法实现注入,那就写个方法去拿
* @author PengKe
* @Date 2018年9月16日 上午12:04:45
*/
public class GetBeanFactory {
private static ApplicationContext factory=new ClassPathXmlApplicationContext("classpath:spring/spring-*.xml");
public static Object getBean(String beanName) {
return factory.getBean(beanName);
}
}
spring 中 webscoket获取bean
猜你喜欢
转载自blog.csdn.net/pk694046220/article/details/82723276
今日推荐
周排行