pooney
article thumbnail
Spring boot Interceptor
Spring boot 2020. 5. 15. 19:55

Interceptor interceptor 생성 1. interceptor 패키기 생성 -> interceptor 클래스 생성 HelloInterceprtor package com.example.demo.interceptor; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; public class HelloInterceptor extends HandlerInterc..

article thumbnail
Spring boot mybatis 사용법
Spring boot 2020. 5. 15. 03:10

mybatis는 크게 2가지로 자바파일을 이용하는 방법과 xml을 이용하는 방법 두가지가 존재한다 기본세팅 application.properties #db연결 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/bootex?serverTimezone=Asia/Seoul spring.datasource.username=root spring.datasource.password=12345 pom.xml org.mybatis.spring.boot mybatis-spring-boot-starter 2.1.2 mysql mysql-connector-java runtime..

article thumbnail
Spring boot 프로젝트 생성
Spring boot 2020. 5. 14. 19:44

Spring boot Spring을 이용하여 개발하려면 톰캣 설치를 시작으로 여러 가지 복잡한 설정을 해야한다. 그러나 애너테이션기능이 강화되면서 점차 웹 어플리케이션도 일반 응용 프로그램을 개발하는 방식으로 바뀌기 시작했다. 이것바로 스프링 부트이다. 스프링부트는 의존성관리가 용이할 뿐만 아니라 배포 와 테스트 역시 스프링프레임워크보다 쉽고 빠르게 할 수 있다. 스프링 부트로 개발하면 메이븐의 라이버러리 자동 업데이트 기능을 이어받을 수 있을 뿐만 아니라 기존 스프링 프레임 워크의 복잡한 설정 과정을 최대한 줄일 수 있어 편리하다. 스프링부트의 장점 일반적인 응용 프로그램을 실행하는 수즌으로 스프링 어플리케이션을 구현 할 수 있다. 프로젝트 환경을 구축할 때 필요한 톰캣, Jetty, UnderFlow..