





이 위치가 있는 지점부터 컴포넌트 스캔 범위

→ 서블릿에서 설정(web.xml)했을 때와 같이 스프링부트는 properties에서 설정

⇒ 요즘엔 프로퍼티 작성대신 yml로 작성
yml, yaml이 좋은 이유
test:
value: hell world!
age: 8
server:
port: 8080
@Configuration
public class SpringConfiguration {
@Value("${test.value}")
public String testValue;
@Value("${test.age}")
public String testAge;
/* 설명. @Value는 시스템 환경변수도 불러올 수 있다. */
@Value("${user}")
public String userName;
@Bean
public Object propertyReadTest(){
System.out.println("testValue = " + testValue);
System.out.println("testAge = " + testAge);
System.out.println("userName = " + userName);
return new Object();
}
}