springboot(2)
-
Spring boot 2.4.5 @AuthenticationPrincipal occurs null
문제 Spring boot 2.4.5로 업그레이드 한 뒤 authentication 값이 null이다. @GetMapping("/api/users/me") public UserResponse getMe(@AuthenticationPrincipal Authentication authentication) { // ... // ... } 해결 PrincipalMethodArgumentResolver를 추가해도 되지만 그냥 @AuthenticationPrincipal annotation을 제거하면 된다. 스프링에서 문서 수정하는걸 깜빡 했나보다. 이슈 링크
2021.04.30 -
SpringBoot Batch에서 JobParameter로 받을 수 있는 Type
개요 SpringBoot Batch에서 JobParameter로 받을 수 있는 타입에 대하여 이야기 합니다. 이슈 SpringBoot Batch 실행 시 JobParameter로 받을 수 있는 타입은 한정되어 있다. String, Boolean, Integer, Date. 하지만 지금은 2019년.. Date는 상당히 골치아프다. 나는 LocalDate를 사용하고 싶었다. 그래서 아래와 같이 JobParameter를 받아줄 수 있는 Class를 만들었다. public class MyJobParameter { @Value("#{jobParameters[requestDate]}") private LocalDate requestDate; public void setRequestDate(String reques..
2019.05.17