일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- ExceptionHandler
- @Async
- mail server
- SMTP
- 세션
- $p.data
- gc
- GIT
- gameday
- CPU 바운드
- project loom
- 웹스퀘어
- .md
- java 21
- virtual threads
- gc튜닝
- 쿠키
- controlleradvice
- 비동기
- 명령
- java
- 캐시
- AWS Game Day
- markdown
- WebSquare5
- github
- Spring
- $p.local
- $p
- SP4
- Today
- Total
목록Framework/Spring - Spring Boot (4)
쉬다가렴
Dependency Spring Boot starter 에 기본적으로 의존 org.springframework.scheduling Enable Scheduling Project Application Class에 @EnableScheduling 추가 @EnableScheduling // 추가 @SpringBootApplication public class SchedulerApplication { public static void main(String[] args) { SpringApplication.run(SchedulerApplication.class, args); } } scheduler를 사용할 Class에 @Component, Method에 @Scheduled 추가 @Scheduled 규칙 Meth..

이번에는 Spring Security가 어떤 과정으로 Authentication 처리를 하는지, 그리고 실제로 어떻게 구현하는지 알아보도록 하자. 1. Spring Security 처리 과정 Spring Security 아키텍쳐는 위와 같으며 각각의 처리 과정에 대해서 자세히 알아보도록 하자.(아래에서 설명하는 내용은 Session을 활용한 Spring Security의 구현 방식으로, Session과 Token 기반의 구현방식에 대해서는 여기를 참고하세요! ) [ 0. 사전 세팅 ] 먼저 프로젝트에서 사용할 Dependency들을 build.gradle에 추가해준다. dependencies { implementation 'org.mariadb.jdbc:mariadb-java-client' impleme..

대부분의 시스템에서는 회원의 관리를 하고 있고, 그에 따른 인증(Authentication)과 인가(Authorization)에 대한 처리를 해주어야 한다. Spring에서는 Spring Security라는 별도의 프레임워크에서 관련된 기능을 제공하고 있는데, 이번에는 Spring Security에 대해서 알아보도록 하겠다. 1. Spring Security란? [ Spring Security란? ] Spring Security는 Spring 기반의 애플리케이션의 보안(인증과 권한, 인가 등)을 담당하는 스프링 하위 프레임워크이다. Spring Security는 '인증'과 '권한'에 대한 부분을 Filter 흐름에 따라 처리하고 있다. Filter는 Dispatcher Servlet으로 가기 전에 적용되..

우리는 기존에 에러를 핸들링 하기 위해서 try-catch를 사용했다. Spring에서는 이러한 것을 편하게 해결하기 위해 지원가능 기능이 있는데 이것이 바로 @ExceptionHandler이다. @Controller public class SimpleController { // ... @ExceptionHandler(CustomException.class) public ResponseEntity handle(IOException ex) { // ... } } 해당 컨트롤러에서 비즈니스 로직을 수행하다가 CustomException이 발생하면 해당 애너테이션이 붙어있는 메서드가 실행되어 에러를 처리하게 된다. 여기서 추가적으로 Controller에서 작성하는 것이 아니라 분리를 해서 처리를 할 수 있는데..