可以使用@Autowired注解那些众所周知的解析依赖性接口,比如:BeanFactory,ApplicationContext,Environment,ResourceLoader,ApplicationEventPublisher,MessageSource package com.mypackage; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.conte…