Inflearn brand logo image

Inflearn Community Q&A

fourier's profile image
fourier

asked

Spring Boot Concepts and Utilization

Embedded Web Server Application Part 1: Containers and Ports

Written on

·

153

0

안녕하세요.

강의 속에서는 다음과 같은 코드를 알려주셨는데, 알려주신 공식문서에서는 이런 예제가 없더라구요. 보통 이런 예시들은 어디에 주로 제시되어 있는 것일까요?

@Component

public class PortListener implements ApplicationListener<ServletWebServerInitializedEvent> {

@Override

public void onApplicationEvent(ServletWebServerInitializedEvent servletWebServerInitializedEvent) {

ServletWebServerApplicationContext applicationContext = servletWebServerInitializedEvent.getApplicationContext();

System.out.println(applicationContext.getWebServer().getPort());

}

}

javaspringspring-boot

Answer 1

0

whiteship님의 프로필 이미지
whiteship
Instructor

동일한 질문에 답변 드렸습니다. 감사합니다.

fourier's profile image
fourier

asked

Ask a question