본문 바로가기

전체 글9

Mybatis Enum 사용 Mybatis 에 Enum을 사용 중 아래와 같은 에러를 만남. nested exception is org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'board_type' from result set. Cause: java.lang.IllegalArgumentException: No enum constant com.oedpus.enums.BoardType.1 org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.result.ResultMapException: Error attempting to g.. 2019. 11. 15.
Spring boot + JSP 1. build.gradle dependency 추가 compile 'org.apache.tomcat.embed:tomcat-embed-jasper' compile 'javax.servlet:jstl:1.2' 2. JSP 디렉토리 추가 및 테스트 JSP 파일 생성 src/main/webapp/WEB-INF/jsp/ 경로에 해당하는 폴더 생성 hello.jsp 파일 생성. 내용은 간단히 본문에 Hello world!! 3. application.yml 수정. JSP 경로 지정 spring: mvc: view: prefix: /WEB-INF/jsp/ suffix: .jsp 4. TestController 생성 @Controller public class TestController { @GetMapping(".. 2019. 9. 20.
Spring boot 에러 페이지 설정 기존에 에러페이지 설정 시 에러 페이지 클래스를 상속받아 구현 했어야 했는데 간단하게 변경됨. resources/templates 혹은 static 폴더 밑에 error 라는 폴더를 생성 404 error에 대한 에러 페이지를 추가하고 싶으면 404.html 파일 생성 400대 에러 전부를 한 페이지로 처리하고 싶을 경우 4xx.html로 생성하면 에러 발생시 에러 페이지로 이동하게 됨. 500대 에러도 위와 동일하게 5xx.html 파일을 생성해주면 됨. 2019. 9. 6.
Spring boot + Mybatis 1. File -> New -> Spring Starter Project 선택. 2. Type : Gradle, Packaging:Jar Java: 8 변경. 3. MyBatis Framework, Lombok, Spring Web 선택 후 Finish. 4. build.gradle 수정 - mariaDB 추가 compile 'org.mariadb.jdbc:mariadb-java-client' ※ gradle 수정 저장 후 프로젝트 우클릭 -> Gradle -> Refresh Gradle Project 진행 5. application.yml 수정 - 데이터소스 추가 spring: datasource: url: jdbc:mariadb://(IP Address):3306/DB명 username: 아이디 pa.. 2019. 9. 4.