Spring MVC获取ApplicationContext
获得了ApplicationContext你就可以根据bean名字去获取相应的bean.啥也不说了,直接上代码:
package com.cloume.tmcp.configuration;
import java.io.Serializable;
import java.util.List;
import org.springframework.beans.BeansException;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware