Servlet이란Servlet은 클라이언트의 요청을 처리하고, 그 결과를 응답하는 Java의 웹 프로그래밍 기술이다.Servlet Container는 웹 서버에 오는 요청을 가장 먼저 받습니다.Servlet Filter를 통해 전달받은 요청을 필터링할 수 있습니다. Spring Security의 Filter도 Servlet Filter에 속하며, 해당 위치에서 인증/인가를 처리합니다.Servlet 특징클라이언트의 요청에 대해 동적으로 작동한다.Java Thread를 이용하여 동작한다.Request, Response 객체를 통해 개발자가 직접 HTTP 요청을 Parsing 하지 않고 편리하게 사용할 수 있게 해 준다.Servlet 통신 방식클라이언트 요청이 Servlet Container로 Request를..
스프링 부트를 기반으로 테스트 코드 작성 시 자주 등장하는 테스트 어노테이션의 사용 상황과 기능에 대해 정리하고자 합니다. @SpringBootTest 어노테이션Annotation that can be specified on a test class that runs Spring Boot Based tests. @SpringBootTest 어노테이션은 스프링 부트 기반 테스트 시에 사용하는 어노테이션이다. 다음과 같은 기능과 특징을 가지고 있습니다. 1. Uses SpringBootContextLoader as the default ContextLoader when no specific @ContextConfiguration(loader=...) is defined. 💬 특정 @ContextConfigu..
@PostConstructSpring calls the methods annotated with @PostConstruct only once, just after the initialization of bean properties. 스프링은 @PostConstruct가 붙은 메서드를 빈 속성 초기화 이후에 단 한 번 호출합니다. The method annotated with @PostConstruct can have any access level, but it can’t be static. @PostConstruct가 붙은 메서드는 static으로 선언될 수 없습니다.초기화 작업을 하므로, 정적 메서드로 선언될 수 없다.@Componentpublic class DbInit { @Autowired ..