Spring Boot 4

스프링 부트 스케줄러 @Scheduled 어노테이션 사용법(@Scheduled Annotation)

@Scheduled 사용법에 대해 소스 예제를 들어 설명하겠습니다. 1. @EnableScheduling 추가 1) @SpringBootApplication에 선언 package me.rooted.schedule; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.scheduling.annotation.EnableScheduling; @EnableScheduling @SpringBootApplication public class SpringSchedulerApplication { public s..

Spring Boot 프로젝트 구조

Spring Boot 프로젝트를 생성하며 많은 고민이 드는 것이 프로젝트 구조입니다. 어떻게해야 좋을지 모르겠다면, 이 글을 참고해주세요. 이 글에서는 크게 2가지의 구조를 설명드립니다. 1. 역할별로 묶기 - spring-boot-project - src/main/java - me.rooted └ SpringBootProjectApplication.java - me.rooted.config └ SwaggerConfig.java └ WebSecurityConfig.java - me.rooted.controller └ BoardController.java └ AccountController.java - me.rooted.domain └ BoardVO.java └ AccountVO.java - me.root..

간단한 스프링 스케줄러(Spring Scheduler) 사용하기 : @Scheduled Annotation

Spring Quartz 없이 간단하게 스케줄러를 사용해보자. 1. @EnableScheduling package me.rooted.mail; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.scheduling.annotation.EnableScheduling; @EnableScheduling @SpringBootApplication public class SpringMailThymeleafApplication { public static void main(String[] args) { Spr..

Spring Boot 메일 전송 : Spring Boot 2, Mail, Thymeleaf

Spring Boot 2.x 기준 Mail Send Client를 간단히 소개해봅니다. 기 프로젝트에 적용하실 분들은 1-2로, 신규 프로젝트로 진행하실 분들은 1-1로 봐주시면 되겠습니다.1-1. 프로젝트 생성 1-2. Maven dependency(pom.xml) 설정 org.springframework.boot spring-boot-starter-mail org.springframework.boot spring-boot-starter-thymeleaf 2. 프로젝트 구조 3. src/main/resources/application.properties 설정## thymeleaf default settingsspring.thymeleaf.prefix=classpath:/templates/spri..