๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๋ฐ˜์‘ํ˜•

์Šคํ”„๋ง3

[Spring Framework] CSRF ์ ์šฉ ์ง€๋‚œ ๋ฒˆ์— spring boot์— csrf๋ฅผ ์ ์šฉํ•˜๋Š” ํฌ์ŠคํŒ…์„ ์˜ฌ๋ ธ์—ˆ๋Š”๋ฐ ๊ทธ๋ƒฅ spring๊ณผ ์ ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ๋‹ฌ๋ผ ๋˜ ํฌ์ŠคํŒ…์„ ์˜ฌ๋ ค๋ณธ๋‹ค! [Spring Boot] spring security - CSRF ์ ์šฉ , +) ajax csrf ์ ์šฉ 1. gradle ํ˜น์€ maven์— 'spring-boot-starter-security' ์ถ”๊ฐ€ implementation 'org.springframework.boot:spring-boot-starter-security' org.springframework.boot spring-boot-starter-security 2.5.5 Spring S.. ynzu-dev.tistory.com web.xml์— dispactcher servlet์„ ๋“ฑ๋กํ•œ๋‹ค. appServlet.. 2021. 12. 14.
[Spring Boot] spring security - CSRF ์ ์šฉ , +) ajax csrf ์ ์šฉ 1. gradle ํ˜น์€ maven์— 'spring-boot-starter-security' ์ถ”๊ฐ€ implementation 'org.springframework.boot:spring-boot-starter-security' org.springframework.boot spring-boot-starter-security 2.5.5 Spring Security๋Š” ์Šคํ”„๋ง ๊ธฐ๋ฐ˜์˜ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ณด์•ˆ์„ ๋‹ด๋‹นํ•˜๋Š” ํ”„๋ ˆ์ž„์›Œํฌ๋กœ Spring Security๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋ณด์•ˆ์ฒ˜๋ฆฌ๋ฅผ ๊ฐ„๋‹จํ•˜๋ฉด์„œ ๊ฐ•๋ ฅํ•˜๊ฒŒ ๊ตฌํ˜„๊ฐ€๋Šฅํ•˜๋‹ค! 2. XXXXApplication.java์— @EnableWebSecurity ์„ ์–ธ @EnableWebSecurity :Spring Security๋ฅผ ํ™œ์„ฑํ™” @EnableWebSecurity @SpringBoot.. 2021. 12. 7.
[Spring] Scheduler(์Šคํ”„๋ง ์Šค์ผ€์ค„๋Ÿฌ) ์„ค์ •ํ•˜๊ธฐ ์Šคํ”„๋ง์—์„œ ํŠน์ • ์‹œ๊ฐ„ ํ˜น์€ ๋ช‡ ๋ถ„, ๋ช‡ ์‹œ๊ฐ„ ๋งˆ๋‹ค ๊ธฐ๋Šฅ์„ ๋™์ž‘ ์‹œํ‚ค๋ ค๋ฉด Spring์—์„œ ์ œ๊ณตํ•˜๋Š” scheduler๋ฅผ ์ด์šฉํ•˜๋ฉด ๋œ๋‹ค. (Spring 3.1๋ถ€ํ„ฐ๋Š” Quartz์—†์ด ๊ฐ„๋‹จํ•˜๊ฒŒ ์Šค์ผ€์ค„๋Ÿฌ ๊ตฌํ˜„์ด ๊ฐ€๋Šฅํ•˜๋‹ค.) โ€‹ ๋จผ์ € applicationContext์— ์Šค์ผ€์ค„๋Ÿฌ๋ฅผ ๋“ฑ๋กํ•œ๋‹ค. (Component Scan์ด ์„ ์–ธ๋˜์–ด ์žˆ๋Š” ํŒŒ์ผ) applicationContext.xml (์š”์•ฝ) => testJob์˜ doJob ๋ฉ”์†Œ๋“œ๋ฅผ 30๋ถ„๋งˆ๋‹ค ์‹คํ–‰ํ•˜๋Š” ์Šค์ผ€์ค„๋Ÿฌ๋ฅผ ๋“ฑ๋กํ–ˆ๋‹ค. testJob์€ ์•„๋ž˜์™€ ๊ฐ™๋‹ค. TestJob.java @Service("testJob") public class TestJob { public synchronized void doJob() { System.out.println("###########.. 2021. 11. 30.
728x90
๋ฐ˜์‘ํ˜•