java16 [JAVA] ObjectUtil [2021.12.15] ์ด ํฌ์คํธ๋ ์๋์ ๊ธ์์ ํ์๋์๋ค. Object๋ฅผ Map์ผ๋ก ๋ณํํ์ฌ, ํน์ ๊ฒฝ๋ก์ ํน์ ๊ฐ์ด ์กด์ฌํ๋์ง ํ๋จํ๋ ์ ํธ๋ฆฌํฐ์ด๋ค. 2021.12.19 - [IT story/Spring] - [Spring] RestTemplate - Java์์ HTTP ํต์ [Spring] RestTemplate - Java์์ HTTP ํต์ [2021.12.15] ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ ์ฅ๋ ๋ฐ์ดํฐ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์๋์ผ๋ก http ํต์ ์ํ๋ ๊ธฐ๋ฅ์ ๊ตฌํํ์๋ค. ์์ง ํ๋ก์ ํธ ๊ธฐํ ์ ์ด๋ผ์ ํด๋น ๊ธฐ๋ฅ์ ๋ํญ ์ ํํ ์๋น์ค๊ฐ ๋ช ์๋์ง ์์์ง๋ง ๊ธฐ๋ณธ ํ yjkim97.tistory.com Exception์ ์ค์ ๊ตฌํํ ๋๋ ์ปค์คํ ํ exception์ผ๋ก ๋ด๋ ธ๋ค. ObjectUtil.java /** * * @.. 2021. 12. 19. [JAVA] HttpUtil [2021.12.15] ์ด ํฌ์คํธ๋ ์๋ ๊ฒ์๊ธ์์ ํ์๋๋ค. Spring RestTemplate ํต์ ํ ๋ ์ฌ์ฉ๋๋ ์ ํธ๋ฆฌํฐ์ด๋ค. 2021.12.19 - [IT story/Spring] - [Spring] RestTemplate - Java์์ HTTP ํต์ [Spring] RestTemplate - Java์์ HTTP ํต์ [2021.12.15] ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ ์ฅ๋ ๋ฐ์ดํฐ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์๋์ผ๋ก http ํต์ ์ํ๋ ๊ธฐ๋ฅ์ ๊ตฌํํ์๋ค. ์์ง ํ๋ก์ ํธ ๊ธฐํ ์ ์ด๋ผ์ ํด๋น ๊ธฐ๋ฅ์ ๋ํญ ์ ํํ ์๋น์ค๊ฐ ๋ช ์๋์ง ์์์ง๋ง ๊ธฐ๋ณธ ํ yjkim97.tistory.com ํน์ํ ๋๋ฉ์ธ์์ path param, query param, request body ํ๋ผ๋ฏธํฐ๋ฅผ ์์ฑํ๋ ์ ํธ๋ฆฌํฐ์ด๋ค. ๊ตฌํ ๋ก์ง์ค์์ Except.. 2021. 12. 19. [Spring] RestTemplate - Java์์ HTTP ํต์ [2021.12.15] ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ ์ฅ๋ ๋ฐ์ดํฐ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์๋์ผ๋ก http ํต์ ์ํ๋ ๊ธฐ๋ฅ์ ๊ตฌํํ์๋ค. ์์ง ํ๋ก์ ํธ ๊ธฐํ ์ ์ด๋ผ์ ํด๋น ๊ธฐ๋ฅ์ ๋ํญ ์ ํํ ์๋น์ค๊ฐ ๋ช ์๋์ง ์์์ง๋ง ๊ธฐ๋ณธ ํ๋ก์ฐ๋ฅผ ๊ตฌ์ฑํด ๊ตฌํํด๋์๋ค. RestTemplate์ ์ด์ฉํด ๊ตฌํํ์๊ณ , ์ ๋ง ์ฌ์๋ค! ๋ฐ๋ก ์ ๊ฒ์ ๋ฐ์ผ๋ฉด์ ๊ตฌํํ ๊ฒ์ด ์๋๊ธฐ ๋๋ฌธ์ ๋ฏธํกํ ์ ์ ์์ ๊ฒ์ด๋ค. ์ฐจ์ฃผ์ ๊ฐ๋ฐํ ๊ฒ๋ค ์ ๊ฒํ์ ๋ค๊ณ ํ๋๋ฐ ๋๋ ์ด๋ฐ ์ ๊ฒ์ด ๋๋ฌด ์ข๋ค.. (๋ถ์กฑํ์ ์๊ณ ๊ณ ์น ์๊ฐ ์๊ฑฐ๋ .. ํ์ง๋ง ์ธ์ ๊น์ง ๋๊ตฐ๊ฐ ์๋ ค์ฃผ๊ณ ๊ณ ์น๊ณ ์ด๋ฐ๊ฑธ ๋ฐ๋ณตํ๋ฉด ์๋๊ฒ ์ง..) ๊ฐ๋ฐํ๊ฒฝ Spring Boot Java 1.8 gradle 1. RestTemplate org.springframework.web.client.RestTemplate Sync.. 2021. 12. 19. [JAVA] java์์ shell command ์คํ 2021.11.24 SpringBoot ๋ฐฑ์๋ ์๋ฒ์์ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ๋ฑ๋ก๋ command๋ฅผ ์คํํ๊ณ ๊ทธ ์๋ต์ ๋ฐ์์ค๋ ๊ธฐ๋ฅ์ ๊ตฌํํ๊ฒ ๋์๋ค. ๋ณธ๊ฒฉ์ ์ผ๋ก ๊ตฌํํ๊ธฐ์ ์์ ์ด๋ป๊ฒ ์คํํ๊ณ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ์์ค๋์ง ํ๋ฒ ๊ฐ๋จํ ์์ ๋ฅผ ๋ง๋ค์ด ๋ณด์๋ค. ์คํํ๊ณ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ์์ค๋ ๊ฒ์ ์๊ฐ๋ณด๋ค ๋งค์ฐ ์ฌ์ ๋ค. ๋ถ๋ช ์ถ๊ฐ์ ์ธ ์์ธ์ฒ๋ฆฌ๋ ํ์ ํ ๊ฒ์ด๋ค. ๊ฐ๋ฐํ๊ฒฝ Spring Boot JAVA 8 Mac OS Java ์ฝ๋๋ก shell ๋ช ๋ น์ด๋ฅผ ์คํํ๋ ๋ฐฉ๋ฒ์๋ ๋๊ฐ์ง๊ฐ ์๋ค. ์ฒซ๋ฒ์งธ๋ Runtime ํด๋์ค๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด๊ณ , ๋๋ฒ์งธ๋ ProcessBuilder ์ธ์คํด์ค๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด๋ค. Runtime ProcessBuilder (Spring boot์์๋ ProcessBuilder๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ ๊ถ์ฅํ๋ค.) 1. O.. 2021. 11. 24. [Spring security] ์ธ์ฆ ๋ฐ ๊ถํ ์ฒดํฌ 2021.10.23 - [IT ๊ธฐ์ /๊ถํ ์ธ์ฆ&์ธ๊ฐ] - [Spring Security] Authentication ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ตฌํ [Spring Security] Authentication ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ตฌํ ํ๋ก์ ํธ๋ง๋ค ๋ก๊ทธ์ธ/ํ์๊ฐ์ /๊ถํ์ธ์ฆ ๋ฑ ๊ธฐ๋ฅ์ ๋งค๋ฒ ๊ตฌํํ๊ธฐ ํ๋ค๋ค. ๊ทธ๋์ ์ง์ ํ๋ก์ ํธ๋ง๋ค ์ ์ฉ์ํฌ Authentication ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๊ฐ๋ฐํ์๋ค. Authentication ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ ์ธ์ฆ ๋ฐ ๊ถํ ๊ด yjkim97.tistory.com 8. AuthorizationChecker.java ignore, permitAll์ฒ๋ฆฌ ๋์ง ์์ ๋ชจ๋ url ์์ฒญ์ด ๋ค์ด์ค๋ฉด AuthorizationChecker๋ฅผ ํตํด ๋ฉ๋ด ๋๋ api์ ๋ํ ๊ถํ ์ฒดํฌ๋ฅผ ํ๋ค. ํด๋น url์ด ๋ฉ๋ด์ด๋ฉด ๊ถํ๊ทธ๋ฃน Aut.. 2021. 10. 24. [Spring Security] ๋ก๊ทธ์ธ ๊ธฐ๋ฅ ๊ตฌํ 2021.10.23 - [IT ๊ธฐ์ /๊ถํ ์ธ์ฆ&์ธ๊ฐ] - [Spring Security] Authentication ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ตฌํ [Spring Security] Authentication ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ตฌํ ํ๋ก์ ํธ๋ง๋ค ๋ก๊ทธ์ธ/ํ์๊ฐ์ /๊ถํ์ธ์ฆ ๋ฑ ๊ธฐ๋ฅ์ ๋งค๋ฒ ๊ตฌํํ๊ธฐ ํ๋ค๋ค. ๊ทธ๋์ ์ง์ ํ๋ก์ ํธ๋ง๋ค ์ ์ฉ์ํฌ Authentication ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๊ฐ๋ฐํ์๋ค. Authentication ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ ์ธ์ฆ ๋ฐ ๊ถํ ๊ด yjkim97.tistory.com 6. ๋ก๊ทธ์ธ ๊ธฐ๋ฅ ๊ตฌํ spring-security์ DaoAuthenticationProvider๋ฅผ ์ปค์คํ ํ์๋ค. (CustomAuthenticationProvider) CustomAuthenticationProvider์์๋ DB์์ ์ฌ์ฉ์ ์ ๋ณด๋ฅผ ๊ฐ.. 2021. 10. 24. [Spring security] Authentication ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ตฌํ ๋ณดํต ์น ์๋น์ค์์๋ ๋ก๊ทธ์ธ๊ณผ ๊ถํ์ธ์ฆ ๋ฑ์ ๊ธฐ๋ฅ์ ํ์์ด๋ฉฐ ๊ตฌํํด์ผํ๋ ๊ธฐ๋ณธ์ค์ ๊ธฐ๋ณธ์ ์ธ ์๋น์ค์ด๋ค. ๋ฌผ๋ก ๋ด๋ถ์์๋ง ์ฌ์ฉํ๋ ์๋น์ค์ธ ๊ฒฝ์ฐ ํ์ ์๋ ๊ธฐ๋ฅ์ธ ๊ฒฝ์ฐ๊ฐ ์กด์ฌํ์ง๋ง, ๋๋ถ๋ถ ์์คํ ์์ ํ์ํ ๊ธฐ๋ฅ์ด๋ฉฐ, ๊ฐ๋ฐ์ ํ ๋๋ง๋ค ์๋ก ๊ตฌํํ๊ณ ,, ์ฌ๊ธฐ์ ๊ธฐ์ ๊ตฌํํ๋ ๋ก์ง์ ์ง์ง๊ธฐํ๊ณ ,, ์ด๋ฐ ๋ฐฉ์์ผ๋ก ์งํํด ์๋ค. ๊ฐ ํ๋ก์ ํธ๋ง๋ค ๊ฐ์ ๊ธฐ๋ฅ์ ๊ตฌํํ๋ ๊ฒ์ธ ๋ฐ ์ด๊ฒ์ ์ฌ๋ด ๋ชจ๋๋ก ๋ง๋ค์ด ์ฌ์ฉํ๋ฉด ์กฐ๊ธ ๋ ๊ฐ๋ฐ์๊ฐ์ ๋จ์ถํ๊ณ , ํ์๋๋ ๋ฒ๊ทธ๋ฅผ ์ค์ผ ์ ์์ง ์์๊น?๋ผ๋ ์๊ฒฌ์ด ๋์ ์ฌ๋ด Authentication ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๋ด๊ฐ ์ง์ ๊ตฌํํ๊ฒ ๋์๋ค. Authentication ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ ์ธ์ฆ ๋ฐ ๊ถํ ๊ด๋ จ ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ฉฐ, ๊ฐ ํ๋ก์ ํธ๋ง๋ค ์ํ๋ ๊ธฐ๋ฅ์ ์ธํ ํ ์ ์๋๋ก ๊ตฌํํ๋ค. ์ฌ๋ด ๋ผ์ด๋ธ๋ฌ.. 2021. 10. 23. [JAVA] JsonUtils import java.io.IOException; import java.util.List; import java.util.Map; import org.springframework.boot.json.JsonParseException; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode.. 2021. 5. 10. [JAVA] PropertyDescriptor ํด๋์ค ํ์ํด๋์ค : IndexedPropertyDescriptor ์์ํด๋์ค : FeatureDescriptor PropertyDescriptor๋ Object์ ํ์์ ์ ๊ทผ์ ๋ฉ์๋(getMethod, setMethod)์ ์์ฑ์ ๋ค๋ฃจ๋ ํด๋์ค์ด๋ค. A PropertyDescriptor describes one property that a Java Bean exports via a pair of accessor methods. ์์ฑ์ PropertyDescriptor(String propertyName, Class beanClass) get/set ์ ๊ทผ์ ๋ฉ์๋๋ฅผ ์ฌ์ฉํ๋ ์์ฑ์ ๋ํ PropertyDescriptor๋ฅผ ๊ตฌ์ฑํ๋ค. PropertyDescriptor(String propertyName, Cla.. 2020. 11. 30. ์ด์ 1 2 ๋ค์