1. 程式人生 > >使用SpringContextHolder獲取bean例項

使用SpringContextHolder獲取bean例項

public static IConstantFactory me(){
    return SpringContextHolder.getBean(beanName:"constantFactory");
}

private static Constants constants = SpringContextHolder.getBean(Constants.class);