목록전체 글 (96)
무소의 뿔처럼
sts 3.x org.mybatis mybatis 3.5.13 org.mybatis mybatis-spring 3.0.1 org.springframework spring-tx ${org.springframework-version} org.springframework spring-jdbc ${org.springframework-version} spring-jdbc , spring-tx : 스프링에서 데이터베이스 처리와 트랜잭션 처리 mybatis , mybatis-spring : MyBatis와 스프링 연동용 라이브러리
Servlet 3.0 전 1.commons의 파일 업로드 2.cos.jar Spring Legacy Project로 생성되는 프로젝은 Servlet 2.5가 기준 https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload/1.3.3 commons-fileupload commons-fileupload 1.3.3 더보기 Servlet 3.0 후 (Tomcat 7.0) 기본적으로 업로드되는 파일을 처리할 수 있는 기능이 추가되어 있음.
https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind/2.14.2 com.fasterxml.jackson.core jackson-databind 2.14.2 더보기 Controller의 메서드 리턴 타입을 객체 타입으로. JSON @GetMapping("/ex06") public @ResponseBody SampleDTO ex06() { log.info("/ex06........................."); SampleDTO dto = new SampleDTO(); dto.setAge(10); dto.setName("홍길동"); return dto; } ResponseEntity @GetMapping("/ex0..
@InitBinder : 파라미터를 변환해서 처리해야 할 경우. binding = 파라미터 수집 스프링 Controller에서는 파라미터를 바인딩할 때 자동으로 호출되는 @InitBinder get으로 파라미터 받아올때 문자열=>Date로 (Controller에서) DTO package com.sun.domain; import java.util.Date; import lombok.Data; @Data public class TodoDTO { private String title; private Date dueDate; } Controller @InitBinder public void initBinder(WebDataBinder binder) { SimpleDateFormat dateFormat = new..