@SpringBootConfiguration
@Configuration 어노테이션의 특수한 경우
Spring Boot 애플리케이션에서는 일반적으로 @Configuration 어노테이션이 구성 클래스를 나타내는데,
@SpringBootConfiguration은
@Configuration 어노테이션을 상속하며
Spring Boot의 *추가 구성 기능을 사용할 수 있도록 한다.
* mvc자동구성, 외부파일에서로드할 수있어 다시 빌드하지않고도 구성정보를 변경, 다양한 환경에서 실행할 수 있도록 프로파일제공, 내장형서버를 사용하여 애플리케이션을 빠르게 시작
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan(basePackages = {"com.example.package"})
public class MyApplicationConfiguration {
// configuration code here
}
https://standout.tistory.com/484
Annotation - @Configuration
@Configuration Spring Framework가 해당 클래스를 구성 클래스로 인식하고 구성을 위해 사용한다. 다른클래스에서 @Autowired로 Bean을 부를 수 있다. import org.springframework.context.annotation.Bean; import org.springframe
standout.tistory.com
https://standout.tistory.com/392
spring-webmvc 4.1.1.RELEASE 란?
스프링 MVC 핵심 모듈, 컨트롤러, 뷰(view), 모델(model) 상호작용 pom.xml에 추가 org.springframework spring-webmvc 4.1.1.RELEASE https://mvnrepository.com/artifact/org.springframework/spring-webmvc/4.1.1.RELEASE
standout.tistory.com
https://standout.tistory.com/487
Annotation - @EnableAutoConfiguration
@EnableAutoConfiguration Spring Boot 애플리케이션에서 다양한 라이브러리들의 자동 구성을 활성화 @SpringBootApplication @EnableAutoConfiguration public class MyApp { public static void main(String[] args) { SpringApplication.run(MyA
standout.tistory.com
https://standout.tistory.com/485
Annotation - @ComponentScan
@ComponentScan 지정된 패키지 및 하위 패키지에서 기본적으로 어플리케이션의 메인 클래스에 선언. Spring Component로 등록되어야 하는 클래스들을 검색한다. = @Component, @Service, @Repository, @Controller, @Conf
standout.tistory.com
'JAVA > Spring' 카테고리의 다른 글
Annotation - @Getter @Setter @ToString (0) | 2023.04.20 |
---|---|
Annotation - @mapper @Select @Insert @Update @Delete (0) | 2023.04.20 |
Annotation - @EnableAutoConfiguration (0) | 2023.04.20 |
Annotation - @SpringBootApplication (0) | 2023.04.20 |
Annotation - @ComponentScan (0) | 2023.04.20 |