Java tutorial
/* * Copyright 2005-2020 Daxia Team All rights reserved. * Support: zhangzhen * License: Daxia Team license */ package com.ling.spring.environment; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.context.annotation.PropertySource; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; @Profile("test") @Configuration // @PropertySource environment?applicationContext.getEnvironment().getProperty("jdbc.driver")? @PropertySource(value = "classpath:config.properties", ignoreResourceNotFound = false, name = "myconf") public class AppConfig { /** * ?bean@value???@Bean * @return */ @Bean public PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { return new PropertySourcesPlaceholderConfigurer(); } }