본문 바로가기
728x90

Spring (boot) 오류 해결37

MyBatis 오류: Invalid bound statement (not found) 원인 마이바티스 mapper인터페이스 id값을 복붙해넣다가 엉뚱한값을 줘놨었다. 왜 발생할까? 아래 나열된 내용 외에서 발견한 케이스가 있다면 댓글로 남겨주시면 다른 분들께 도움 될 것 같습니다 :) Mapper 인터페이스와 XML의 오타 기본적으로 Mapper 인터페이스와 XML에 오타가 있는지 확인해보자. 문 등에 선언하는 id에 오타가 있을 수도 있고, 선언되어 있는 id가 Mapper 인터페이스의 메서드명과 다른지 확인해보자. 인터페이스의 이름과 XML 파일에 선언된 이름이 달라서 생길 수도 있다. 아래와 같이 IDE에서 쉽게 발견하기 어려운 공백이 숨어있는 경우도 있다. ... https://madplay.github.io/post/mybatis-invalid-bound-statement-not.. 2022. 2. 24.
Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: com/MyBlog/Dto/Board (wrong name: update board set title=#{board.title},content=#{board.content} where no=#{no} 파라미터 값 넣어줄때 오타나서 없는 객체 값 넣어주면 오류난다 2022. 2. 23.
$.ajax 값 가져오기 오류(다른 태크 input값 가져와짐) 해결 JSP 자바스크립트 title:$("#title").val() saveTheWriting: function () { let data = { title: $("#title").val(), content: $("#summernote").val(), categoryName: $("#categoryName").val(), channelName: $("#channelName").val(), }; console.log("saveTheWriting", data); $.ajax({ type: "POST", url: "/board/saveTheWritingForm", data: JSON.stringify(data), contentType: "application/json; charset=utf-8", dataTyp.. 2022. 2. 22.
스프링 URI 한글 깨짐 문제 여러가지 시도 중 방법 4에 겨우 해결을 보았다. String Uri = request.getRequestURI(); String encodeUri = UriEncoder.decode(Uri); 방법1 Window > Preferences > General > Workspace 하단 좌측 Text file encoding = Other: UTF-8 변경 출처: https://denodo1.tistory.com/187 [dBack] 방법2 SpringSecurity 사용시. CsrfFilter 앞에 CharacterEncodingFilter를 놓아야 한다. @Configuration @EnableWebMvcSecurity public class SecurityConfig extends WebSecurity.. 2022. 2. 20.
JSP 날짜 변환 에러(게시판, 오늘 게시글 날짜 구분하기) 최종 정리 @Controller Date today_date = new java.util.Date(); DateFormat dateFormat_year = new SimpleDateFormat("yy/MM/dd"); String today_str_year=dateFormat_year.format(today_date); model.addAttribute("today_str_year", today_str_year); JSP 게시판 글 작성 중 오늘 등록된 게시글이면 시,분,초가 보이고 일자가 다르면 년,월,일이 보이게 하려 했다. DB에는 TimeStamp의 Curren_TimeStamp였나? 이걸로 자동 등록 시켜주고 JSP에서는 Date date = new java.util.Date(); 로 현재 시간을.. 2022. 2. 19.
JSTL if문 학습 ${getChannelName} test="${channelName} ne ${getChannelName}" 위에 if문 조건 test가 왜 안먹힐까? 하다 검색해보며 알아보다가 아래와 같이 수정하니 먹혔다. ${getChannelName} test="${channelName ne getChannelName}" 알고보면 쉬운건데 흠.. 2022. 2. 18.
[Spring] Request method 'GET' not supported 라는 에러, @PathVariable 기본값 설정하기 https://leeborn.tistory.com/entry/Spring-PathVariable-%EA%B8%B0%EB%B3%B8%EA%B0%92-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0 [Spring] @PathVariable 기본값 설정하기 @Controller에서 파라미터를 받는 방법은 아래와 같은 방법들이 있다. 1. /API_NAME?key1=val1 2. /API_NAME/{value1} 선호하는 방식대로 하면 되겠지만, 여기서는 2번과 관련된 글이다. 2번과 같은 방식으로 받.. leeborn.tistory.com @Controller에서 파라미터를 받는 방법은 아래와 같은 방법들이 있다. 1. /API_NAME?key1=val1 2. /API_NAME/{value1.. 2022. 2. 17.
728x90