Web/Spring 14

Spring boot REST API + MySQL(오라클, mybatis)

참고한 영상 www.youtube.com/watch?v=QzHkJsALmyw 디펜던시는 이것 추가 mysql 디펜던시와 mybatis 디펜던시를 사용하기 때문에 넣어줌 버전은 삭제해줘도 된다고함 mysql mysql-connector-java org.mybatis.spring.boot mybatis-spring-boot-starter 2.1.3 추가한 뒤 여기에 username과 password를 적어줌 여기서는 root와 123456 mybatis를 사용하면 sql과 관련된 복잡한 설정없이 이것만 작성해줘도 된다고 함 spring.datasource.url=jdbc:mysql://localhost:3306/spring?useUnicode=true&characterEncoding=utf8&serverTi..

Web/Spring 2020.09.18

Spring boot - RESTful API(2)

어제 연습한 코드 수정 이전에 작성한 코드는 post를 한 뒤 user/all 이 아닌 user/{id}로 조회를 할 경우 값이 나오지 않음. url 설계가 잘못 되었다는 피드백을 받고 url에서 데이터를 다 받게 하지 않고 body에서 json 형태로 데이터를 주고 받는 형식으로 수정함 RESTful API uri 설계에 대해서도 알아봐야겠다. body에서 json 데이터가 올 경우 이를 내가 원하는 타입으로 역직렬화 해야하는데 jackson이라는 라이브러리가 제공하는 ObjectMapper 기능이 필요함 Getting Started with Deserialization in Jackson | Baeldung Use Jackson to map custom JSON to any java entity gr..

Web/Spring 2020.09.17

spring framework 설치 및 환경설정 (spring legacy project/tomcat)

Spring Tools 4 is the next generation of Spring tooling Largely rebuilt from scratch, Spring Tools 4 provides world-class support for developing Spring-based enterprise applications, whether you prefer Eclipse, Visual Studio Code, or Theia IDE. spring.io 여기서 STS 4 다운로드 workspace 경로 설정 후 Help -> Eclipse Market 에서 Spring Tools 3를 설치해줌 Window -> Preference General -> workspace 에서 인코딩을 utf-8로 바꿔줌 We..

Web/Spring 2020.09.16