• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

18.12.05 21:38 작성 조회수 91

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

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