강의

멘토링

커뮤니티

인프런 커뮤니티 질문&답변

with_all님의 프로필 이미지
with_all

작성한 질문수

스프링 부트 개념과 활용

내장 웹 서버 응용 1부 : 컨테이너와 포트

작성

·

154

0

안녕하세요.

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

@Component

public class PortListener implements ApplicationListener<ServletWebServerInitializedEvent> {

@Override

public void onApplicationEvent(ServletWebServerInitializedEvent servletWebServerInitializedEvent) {

ServletWebServerApplicationContext applicationContext = servletWebServerInitializedEvent.getApplicationContext();

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

}

}

답변 1

0

백기선님의 프로필 이미지
백기선
지식공유자

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

with_all님의 프로필 이미지
with_all

작성한 질문수

질문하기