스프링 포맷터(Formatter)
·
spring boot
참고자료 https://develop-writing.tistory.com/105 스프링 포맷터(Formatter), 포맷터를 지원하는 ConversionService 스프링 포맷터란(Formatter)?? 웹 애플리케이션에서 객체를 문자로, 문자를 객체로 변환하는 예 화면에 숫자를 출력해야 하는데, Integer => String 출력 시점에 숫자 1000 문자 "1,000" 이렇게 1000 단위에 develop-writing.tistory.com 스프링 포맷터(Formatter) - 웹 애플리케이션에서 객체를 문자로, 문자를 객체로 변환하는 예 ex) 숫자 1000 -> "1,000" => 쉼표를 넣어서 출력 "1,000" -> 1000 날짜 객체"2021-01-01 10:50:11" 출력 or 반대 ..
스프링 타입 컨버터 - Converter
·
spring boot
참고자료 https://develop-writing.tistory.com/103 스프링 타입 컨버터 - Converter 스프링 타입 컨버터란? 스프링을 사용해 애플리케이션을 개발할 때 문자를 숫자로 변환하거나, 반대로 숫자를 문자로 변환해야 하는 것처럼 타입을 변환할 때 사용하는 도구입니다. 스프링 MVC develop-writing.tistory.com * Converter Prototype package org.springframework.core.convert.converter public interface Converter { T covert(S source); } 스프링은 확장 가능한 컨버터 인터페이스를 제공 스프링에 추가적인 타입 변환이 필요하면 이 컨버터 인터페이스를 구현해서 등록 pack..
Spring Security 기본 로그인 화면 제거
·
spring boot/setting
// 스프링 시큐리티 의존성 implementation('org.springframework.boot:spring-boot-starter-oauth2-client') @SpringBootApplication(exclude = SecurityAutoConfiguration.class)
.gitignore파일 제대로 동작하지 않는다면?
·
spring boot/setting
.gitignore가 제대로 동작하지 않아서 ignore처리된 파일이 changed 파일에 계속 뜨는 경우 1.1 원인 .gitignore에 파일을 추가하기 전에 stage에 올라간 파일들이 캐시처리되어 기록이 남아있기 때문 1.2 해결 git rm -r --cached . git add . git commit -m "fixed untracked files" git push origin 자신의 branch 👍 해결완료
타임리프 정리-2
·
spring boot
1. 유틸리티 타임리프에서 자바8 날짜인 LocalDate, LocalDateTime, Instant를 사용하려면 추가 라이브러리 필요 -> 스프링 부트 타임리프를 사용하면 자동으로 추가(걱정 X) 사용예시 // basic/date.html // BasicController 추가 @GetMapping("/date") public String date(Model model) { model.addAttribute("localDateTime", LocalDateTime.now()); return "basic/date"; } 2. URL 링크 // BasicController 추가 @GetMapping("/link") public String link(Model model) { model.addAttribute..