1、@PropertySource
import org.springframework.core.env.Environment; @PropertySource("aaajdbc.properties") public class ConfigAOP { @Value("${beanchange.changename}") String changename; @Autowired private Environment env; } 测试: ConfigAOP configAOP = annotationConfigApplicationContext.getBean(ConfigAOP.class); System.out.println(configAOP.getChangename()); Environment environment = configAOP.getEnv(); System.out.println(environment.getProperty("beanchange.changename"));