본문 바로가기 메뉴 바로가기

How to be awesome

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

How to be awesome

검색하기 폼
  • 분류 전체보기 (145)
    • Java (32)
    • Algorithm (26)
    • JSP & Servlet (0)
    • Spring Framework (14)
    • Git & Github (6)
    • Database (11)
    • Linux (3)
    • Design Pattern (12)
    • JPA (7)
    • Project (14)
    • JavaScript (4)
    • Development (10)
    • HTML&CSS (1)
    • AWS (5)
  • 방명록

InitializingBean (1)
BeanFactory로 Bean생성시에 주의할점 (feat. InitializingBean)

Bean을 생성하는 3가지 방법 1. @Component 애노테이션으로 생성하기 스프링부트에서 가장 보편적으로 사용하는 방법으로 @Component 애노테이션을 사용할 수 있다. 개발자가 직접 작성한 Class에만 사용할 수 있다. @Component public class MyComponent1 implements InitializingBean { @Override public void afterPropertiesSet() throws Exception { System.out.println("MyComponent1.afterPropertiesSet"); } } 2. @Bean 애노테이션으로 생성하기 주로 외부 라이브러리의 객체들을 Bean으로 만들때 사용하거나, 같은 타입의 빈을 여러개 생성하고 싶을 ..

Spring Framework 2021. 11. 5. 03:05
이전 1 다음
이전 다음

Blog is powered by Tistory / Designed by Tistory

티스토리툴바