[java] @Builder와 @NoArgsConstructor 동시에 사용하기 @Builder @NoArgsConstructor @AllArgsConstructor public ...
[java] client ip 구하기 package com.web.cms.core.common.util; import jakarta.servlet.http.HttpServletRequest; import lombok.extern.slf4j.Slf4j; import java.net.InetAddress; import java.net.UnknownHostException; @Slf4j public class NetworkUtil { public static String getClientIp( HttpServletRequest request ) throws UnknownHostException { String ip = request.getHeader( "X-Forwarded-For" ); if( ip == null || ip.length() == 0
[error] java.net.MalformedURLException: Local host name unknown: 말인지 방구인지 모를 에러가 떴다. 해결법은 hosts 파일을 열어서 127.0.0.1 localhost MacBookPro.local 식으로 localhost 옆에 호스트명을 추가해 주면 해결된다.