-
카테고리
-
세부 분야
백엔드
-
해결 여부
미해결
18.12.05 21:38 작성 조회수 91
0
안녕하세요.
강의 속에서는 다음과 같은 코드를 알려주셨는데, 알려주신 공식문서에서는 이런 예제가 없더라구요. 보통 이런 예시들은 어디에 주로 제시되어 있는 것일까요?
@Componentpublic class PortListener implements ApplicationListener<ServletWebServerInitializedEvent> {
@Override
public void onApplicationEvent(ServletWebServerInitializedEvent servletWebServerInitializedEvent) {
ServletWebServerApplicationContext applicationContext = servletWebServerInitializedEvent.getApplicationContext();
System.out.println(applicationContext.getWebServer().getPort());
}
}
답변을 작성해보세요.
0
답변 1