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

๊ฐœ๋ฐœ93

[JD-GUI] java 9 ์ด์ƒ์—์„œ ์‹คํ–‰ ์˜ค๋ฅ˜ : module java.base does not "opens jdk.internal.loader" to unnamed module ์†Œ์Šค๋ฅผ ๋””์ปดํŒŒ์ผํ•  ๋•Œ JD-GUI๋ฅผ ์‚ฌ์šฉํ•˜๋Š”๋ฐ ๊ฐ‘์ž๊ธฐ ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜๋ฉด์„œ ์‹คํ–‰์ด ๋˜์ง€ ์•Š์•˜๋‹ค. WARNING: All illegal access operations will be denied in a future release Exception in thread "main" java.lang.reflect.InaccessibleObjectException: Unable to make jdk.internal.loader.ClassLoaders$AppClassLoader(jdk.internal.loader.ClassLoaders$PlatformClassLoader,jdk.internal.loader.URLClassPath) accessible: module java.base does not "op.. 2021. 12. 3.
[JPA] ๋ฐ์ดํ„ฐ๋ฅผ insert ํ•˜๊ธฐ ์ „์— selectํ•˜๋Š” ์ด์œ  JPA๋ฅผ ์ด์šฉํ•˜์—ฌ DB์— ๋ฐ์ดํ„ฐ๋ฅผ insertํ•˜๊ฒŒ ๋˜๋ฉด id๋ฅผ ์กฐ๊ฑด์œผ๋กœ select๋ฅผ ๋จผ์ € ํ•˜๊ณ , insert๋ฅผ ํ•˜๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. (JPA๋Š” ์กฐํšŒ ํ›„ ๋ฐ์ดํ„ฐ๊ฐ€ ์กด์žฌํ•œ๋‹ค๋ฉด update๋ฅผ ์‹คํ–‰ํ•˜๊ณ  ์กด์žฌํ•˜์ง€ ์•Š์œผ๋ฉด insert๋ฅผ ์‹คํ–‰ํ•œ๋‹ค.) ๋Œ€๋Ÿ‰ ๋ฐ์ดํ„ฐ๋ฅผ ์ฒ˜๋ฆฌํ•˜๋ ค๋‹ค ๋ณด๋‹ˆ savaAll์„ ์‚ฌ์šฉํ•˜๊ฒŒ ๋˜์—ˆ๋Š”๋ฐ, xxxRepository.saveAll(entity); 1000๊ฑด์˜ ๋ฐ์ดํ„ฐ๋ฅผ ํ•œ๋ฒˆ์— ๋“ฑ๋กํ•˜๋ ค๋ฉด select๋ฅผ 1000๋ฒˆ ์‹คํ–‰ํ•˜๋Š”..... JPA๊ฐ€ ํŽธ๋ฆฌํ•˜๊ธด ํ•œ๋ฐ.. ์ด๋Ÿฐ ๋ถ€๋ถ„์€.. ์ฐธ ๊ทธ๋ ‡๋‹ค ๊ทธ๋ž˜์„œ save() ๋ฉ”์†Œ๋“œ๊ฐ€ ์–ด๋–ป๊ฒŒ ์ฒ˜๋ฆฌ๋˜๊ณ  ์žˆ๋Š”์ง€ ์‚ดํŽด๋ดค๋‹ค. @Transactional public S save(S entity) { if (entityInformation.isNew(entity)) { e.. 2021. 12. 2.
[JSP/HTML] ERR_CACHE_MISS ์—๋Ÿฌ ๋ฐœ์ƒ ์›นํŽ˜์ด์ง€(jsp, html)์—์„œ ๋’ค๋กœ๊ฐ€๊ธฐ๋ฅผ ํ–ˆ์„ ๋•Œ 'ERR_CACHE_MISS' ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•œ ์ ์ด ์žˆ๋‹ค ์ด๋Ÿด ๊ฒฝ์šฐ ์•„๋ž˜์™€ ๊ฐ™์ด ํ•ด๊ฒฐํ•˜๋ฉด ๋œ๋‹ค! jsp๋‚˜ html๊ณผ ๊ฐ™์€ ์›นํŽ˜์ด์ง€ ์ƒ๋‹จ์— header ์ถ”๊ฐ€ response.setHeader("Cache-Control","no-cache); response.setHeader("Pragma","no-cache"); spring ์„ค์ •์—์„œ ๊ณตํ†ต์œผ๋กœ ์ฒ˜๋ฆฌ ๋ณธ์ธ์€ csrf ์ฒ˜๋ฆฌ ๋•Œ๋ฌธ์— WebSecurityConfigurerAdapter๋ฅผ ์ƒ์†๋ฐ›์€ classs๊ฐ€ ์žˆ์—ˆ๊ณ , configure ๋ฉ”์†Œ๋“œ๋ฅผ ์˜ค๋ฒ„๋ผ์ด๋“œํ•˜์—ฌ csrf ๋ฐฉ์–ด์ฝ”๋“œ๋ฅผ ์„ธํŒ…ํ•˜์˜€๋‹ค. ๊ทธ๋ž˜์„œ ์ด ๋ถ€๋ถ„์— ์บ์‹œ ๋ฐฉ์ง€ ์ฝ”๋“œ๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ ์ž‘์„ฑํ•จ! @Override protected void configure(HttpS.. 2021. 12. 1.
[MyBatis] ๋ณ€์ˆ˜ ์‚ฌ์šฉ์‹œ #{value}, ${value}์˜ ์ฐจ์ด ์ง€๋‚œ๋ฒˆ์— ํšŒ์‚ฌ์—์„œ ์–˜๊ธฐ๋ฅผ ๋‚˜๋ˆ„๋‹ค๋ณด๋‹ˆ ๋ชจ๋ฅด๋Š” ์‚ฌ๋žŒ๋„ ์žˆ๊ธธ๋ž˜ ์ •๋ฆฌํ•ด๋ณธ๋‹ค! 1. #{} ์‚ฌ์šฉ SELECT * FROM USER WHERE USER_ID = #{user_id} user_id์˜ ๊ฐ’์ด test๋ผ๋ฉด ์•„๋ž˜์™€ ๊ฐ™์€ ์ฟผ๋ฆฌ๊ฐ€ ์‹คํ–‰๋œ๋‹ค. SELECT * FROM USER WHERE USER_ID = 'test'; 2. ${} ์‚ฌ์šฉ SELECT * FROM USER WHERE USER_ID = ${user_id} user_id์˜ ๊ฐ’์ด test๋ผ๋ฉด ์•„๋ž˜์™€ ๊ฐ™์€ ์ฟผ๋ฆฌ๊ฐ€ ์‹คํ–‰๋œ๋‹ค. SELECT * FROM USER WHERE USER_ID = test ${}๋ฅผ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ ์ž‘์€๋”ฐ์˜ดํ‘œ๊ฐ€ ์•ˆ๋ถ™๊ธฐ๋•Œ๋ฌธ์— ์˜ˆ์•ฝ์–ด๋‚˜ ์นผ๋Ÿผ๋ช… ๋“ฑ์„ ์‚ฌ์šฉํ•  ๋•Œ ์ ์šฉํ•˜๋ฉด ๋œ๋‹ค ์˜ˆ๋ฅผ ๋“ค์–ด ์•„๋ž˜์™€ ๊ฐ™์ด ์ฟผ๋ฆฌ๋ฅผ ์ž‘์„ฑํ–ˆ์„ ๊ฒฝ์šฐ SUM( CASE WHEN .. 2021. 11. 30.
[Ajax] ํŒŒ์ผ file ๋‹ค์šด๋กœ๋“œ ๋ฐ›๊ธฐ ๊ฒฐ๋ก ๋ถ€ํ„ฐ ๋งํ•˜์ž๋ฉด xhr.responseType = "blob" ๋กœ ์„ค์ •ํ•ด์•ผ ํ•œ๋‹ค! ๊ธฐ์กด์— ์‚ฌ์šฉํ•˜๋˜ ์ œ์ด์ฟผ๋ฆฌ ๋ฒ„์ „์ด 1.11.1์ด์˜€๋Š”๋ฐ ์ด ๋ฒ„์ „์€ blob์ด ์ ์šฉ์•ˆ๋˜๋”๋ผ.. ๋ฒ„์ „ ๋ฌธ์ œ์ธ์ค„ ๋ชจ๋ฅด๊ณ  ํ•œ์ฐธ์„ ์”จ๋ฆ„ ํ–ˆ๋Š”๋ฐ 3.6.0์œผ๋กœ ์˜ฌ๋ฆฌ๋‹ˆ๊นŒ ํ•ด๊ฒฐ๋๋‹ค. (์–ด๋–ค ๋ฒ„์ „๋ถ€ํ„ฐ ๋˜๋Š” ๊ฑด์ง€๋Š” ๋ชจ๋ฅด๊ฒ ์Œ) ์•„๋ž˜ ์˜ˆ์‹œ ์ฐธ์กฐ!! let options = { url: "[[@{/}]]download" , beforeSubmit : loadingAjaxImage , contentType: "application/x-www-form-urlencoded;charset=UTF-8" , xhr: function () { let xhr = new XMLHttpRequest(); xhr.onreadystatechange = function .. 2021. 11. 30.
[Apache] web-was ์—ฐ๋™, socket_timeout ์„ค์ • ์ด์Šˆ ํ˜„์ƒ web-was๊ฐ€ ์—ฐ๋™๋œ ํ”„๋กœ์ ํŠธ์—์„œ ํ…Œ์ŠคํŠธ๋ฅผ ํ•˜๋Š”๋ฐ ๋ฐ์ดํ„ฐ ์ค‘๋ณต ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜์˜€๋‹ค. ๋‹ค๋ฅธ ์„œ๋ฒ„๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ „์†กํ•˜๋Š”๋ฐ ๊ทธ ์„œ๋ฒ„์—์„œ ์‘๋‹ต์ด 10์ดˆ์•ˆ์— ์˜ค์ง€ ์•Š์•„ ์šฐ๋ฆฌ ์„œ๋ฒ„์—์„œ๋Š” ์žฌ์š”์ฒญ์„ ํ•˜๊ณ , ๊ทธ ์„œ๋ฒ„์—์„œ๋Š” ์ด๋ฏธ ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ๋ฅผ ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— ์ค‘๋ณต ์š”์ฒญ์ด ๋œ ๊ฒƒ์ด๋‹ค. (์šฐ๋ฆฌ ์„œ๋ฒ„์—์„œ๋Š” ํ•ด๋‹น ์š”์ฒญ๊ฑด์ด ๋ฏธ์™„๋ฃŒ ์ƒํƒœ์ด๊ณ ..) apache์ชฝ ์„ค์ • ํŒŒ์ผ ์ค‘ workers.properties๊ฐ€ ์žˆ๊ณ , socket_timeout์ด๋ผ๋Š” ํ•ญ๋ชฉ์ด ์žˆ๋Š”๋ฐ ์ด๊ฒŒ 10์œผ๋กœ ์„ค์ •๋˜์–ด ์žˆ์„ ๊ฒฝ์šฐ ์‘๋‹ต์ด ํ•ด๋‹น ์‹œ๊ฐ„ ์•ˆ์— ์˜ค์ง€ ์•Š์œผ๋ฉด ์žฌ์š”์ฒญํ•˜๊ฒŒ ๋œ๋‹ค... ์„œ๋ฒ„์˜ ์ƒํ™ฉ์— ๋งž๊ฒŒ ์กฐ์ ˆํ•ด์„œ ์“ฐ์ž.. worker.worker1.socket_timeout=10 2021. 11. 30.
[Tomcat] JNDI ์ •๋ณด ์•”ํ˜ธํ™”(DB์ •๋ณด : url, username, passowrd) / KDF ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์ด์šฉ 1. url, username, password๋ฅผ encrypt ํ•œ๋‹ค. KDFEncrypted.java import java.security.MessageDigest; import javax.crypto.Cipher; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; import org.apache.commons.codec.binary.Hex; public class KDFEncrypted { public static void main(String[] args) { String key = "test"; String url = "jdbc:tibero:thin:@10.10.10.XX:XXXX:tibero"; St.. 2021. 11. 30.
[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
๋ฐ˜์‘ํ˜•