Java(153)
-
Spring boot의 json 형식에 맞지 않을때, 그 데이터를 로그로 뿌려 주기
@ControllerAdvice 사용request body는 1회만 읽을 수 있기 때문에, ContentCachingRequestWrapper를 이용하여 다음 Filter에 전달GlobalExceptionHandler@Slf4j@ControllerAdvicepublic class GlobalExceptionHandler { @ExceptionHandler(HttpMessageNotReadableException.class) public ResponseEntity handleInvalidJson(HttpServletRequest request, Exception ex) { String body = extractBody(request); log.error("💥 Inval..
2025.04.07 -
alpine에 설치할 openjdk 버전 찾기
https://pkgs.alpinelinux.org/packages Package index - Alpine Linux packagesPackage name Branch edge v3.21 v3.20 v3.19 v3.18 v3.17 v3.16 v3.15 v3.14 v3.13 Repository All community main testing Architecture All aarch64 armhf armv7 loongarch64 ppc64le riscv64 s390x x86 x86_64 mips64 Type All Origins Flagged All Flagged Maintainer Alpkgs.alpinelinux.org
2025.03.30 -
Lombok 설치
@Slf4j를 사용하기 위해서 필요jar 파일을 STS 실행파일이 있는 곳에 넣고 실행
2025.03.21 -
JSESSIONID 다른 도메인에 전달
clientcredentials: 'include' const response = await fetch('http://localhost:8080/topics/' + name, { // REST Proxy endpoint method: 'POST', headers: { 'Content-Type': 'application/vnd.kafka.avro.v2+json' }, credentials: 'include', // ✅ This line allows cookies like JSESSIONID to be sent body: JSON.stringify(payload) ..
2025.03.14 -
has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'.
credentials: 'include'를 설정하면, 서버에서는 아래와 같이 설정되어야 함allowCredentials(true) 추가되어야 함 public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedOrigins("도메인1", "도메인2") // Match your HTML server address .allowedMethods("*") .allowedHeaders("*") .allowCrede..
2025.03.14 -
Cors 에러 처리
@Configurationpublic class CorsConfig { @Bean public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurer() { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedOrigins("http://127.0.0.1:5500") // Match your HTML server address .allowedMethods(..
2025.03.14