전체 글 (44) 썸네일형 리스트형 http 415 error, ajax 415 에러는 클라이언트에서 보내는 데이터 타입과 서버에서 받는 데이터 타입이 달라서 발생하는 문제로, 나같은 경우 대체로 컨트롤러에 @ReqestBody 붙여놓고 json 타입으로 보내지 않았을 때 발생했다. 이런 경우엔 ajax로 보낼때 contentType: 'application/json; charset=utf-8' 을 명시해 주면 해결된다. 그런데 가끔 이걸 붙여도 에러가 나는 경우가 있는데...지금까진 100퍼센트 확률로 오탈자 때문이였다. 어제는 세미콜론을 붙이지 않아서 하루종일 에러잡는데 시간을 보냄... 'utf-8'을 'utf8'로 써서 오류가 난 적도 있다. 분명 다음번에 또 이럴거같아서 기록 남겨놓음 코프링 @Validated + @RestControllerAdvice 이용해서 파라미터 null check 하기 1. build.gradle 에 의존성 추가 implementation 'org.springframework.boot:spring-boot-starter-validation' 2.컨트롤러 메소드의 검하고자 하는 파라미터 앞에 @Validated 붙여주기 3. 검사하고자 하는 dto에 @field: NotNull 붙여주기 주의할 점 import 할 때 jakarta.validation.constraints.NotNull 위의 경로로 해줘야함 org.jetbrains.annotations 이 경로도 뜨는데 이걸로 하니 어째선가 안됨,, @field: 의 경우 코틀린일 때만 필수 4. @RestControllerAdvice 생성 @RequestBody에서 발생한 오류는 MethodArgumentNotVali.. the apache tomcat native library could not be found using names [tcnative-2, libtcnative-2, tcnative-1, libtcnative-1] 대충 내장 톰캣이 라이브러리를 못 찾는다는 내용인데, https://tomcat.apache.org/download-native.cgi 1. 여기 주소로 들어가서 화면 젤 아랫단에 Standard zip - recommended(PGP, SHA512)를 다운받고 Apache Tomcat® - Tomcat Native Downloads Welcome to the Apache Tomcat® Native software download page. This page provides download links for obtaining the latest version of Tomcat Native software, as well as links to the archives of older releases. Onl.. 이전 1 ··· 8 9 10 11 12 13 14 15 다음