728x90
๋ฐ˜์‘ํ˜•

์ „์ฒด ๊ธ€ 1332

[JAVA] String ๋ฐฐ์—ด ์ดˆ๊ธฐํ™”

1. ํฌ๊ธฐ๋งŒ ์ง€์ •ํ•ด์„œ ์ดˆ๊ธฐํ™” String[] configValArr = new String[5]; // ๊ธธ์ด 5์งœ๋ฆฌ ๋ฐฐ์—ด ์ƒ์„ฑ, ์ดˆ๊ธฐ๊ฐ’์€ null 2. ์ดˆ๊ธฐ ๊ฐ’์„ ํ•จ๊ป˜ ์ง€์ •ํ•ด์„œ ์ดˆ๊ธฐํ™” String[] configValArr = new String[] {"val1", "val2", "val3"}; 3. ์ถ•์•ฝํ˜• ์ดˆ๊ธฐํ™” String[] configValArr = {"val1", "val2", "val3"};

JAVA 2025.07.21

[Error][JAVA] error: package * does not exist

Java ์ปดํŒŒ์ผ๋Ÿฌ๊ฐ€ ํŒจํ‚ค์ง€๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†๋‹ค๋Š” ์˜๋ฏธ์ž…๋‹ˆ๋‹ค.์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋ ค๋ฉด ์•„๋ž˜ ์‚ฌํ•ญ๋“ค์„ ํ™•์ธํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค: โœ… 1. ํ•ด๋‹น ํŒจํ‚ค์ง€์™€ ํด๋ž˜์Šค๊ฐ€ ์‹ค์ œ๋กœ ์กด์žฌํ•˜๋Š”์ง€ ํ™•์ธ ํŒŒ์ผ์ด ํŒจํ‚ค์ง€์— ์žˆ๋Š”์ง€ ํ™•์ธํ•˜์„ธ์š”.ํ•ด๋‹น ๊ฒฝ๋กœ์— ํŒŒ์ผ์ด ์—†์œผ๋ฉด importํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ์กด์žฌํ•˜์ง€ ์•Š๋Š”๋‹ค๋ฉด:ํŒŒ์ผ์„ ์ถ”๊ฐ€ํ•˜๊ฑฐ๋‚˜๋‹ค๋ฅธ ์œ„์น˜์˜ DTO๋ฅผ importํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.โœ… 2. ํ”„๋กœ์ ํŠธ์— ํ•ด๋‹น ๋ชจ๋“ˆ์ด ํฌํ•จ๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธ๋ชจ๋“ˆ์˜ build.gradle ๋˜๋Š” pom.xml์—์„œ ํ•ด๋‹น๋ชจ๋“ˆ์„ dependencies์— ์ถ”๊ฐ€ํ–ˆ๋Š”์ง€ ํ™•์ธํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.Gradle ์˜ˆ์‹œ:implementation project(':module:redis')Maven ์˜ˆ์‹œ: salesinsight.nxtlvl.module redis 1.0.0โœ… 3. IDE์—์„œ ๋นŒ..

Error 2025.07.18

[DB][MySQL] ๊ณต๋ฐฑ๊ณผ Null ๋ชจ๋‘ ์ œ์™ธํ•˜๊ธฐ

SELECT *FROM your_tableWHERE your_column IS NOT NULL AND TRIM(your_column) != '';โœ… ์ฐธ๊ณ : TRIM() ์‚ฌ์šฉ ์ด์œ TRIM()์€ " "(์ŠคํŽ˜์ด์Šค), \t, \n ๋“ฑ์˜ ๊ณต๋ฐฑ์„ ์ œ๊ฑฐํ•ด์ค๋‹ˆ๋‹ค.๊ณต๋ฐฑ๋งŒ ์žˆ๋Š” ๋ฌธ์ž์—ด๋„ TRIM() ํ›„ ''๊ฐ€ ๋ฉ๋‹ˆ๋‹ค.

DB 2025.07.16

[js] URL ์ด๋™ ๋ฐ ํžˆ์Šคํ† ๋ฆฌ ์ œ์–ด ๋ฉ”์„œ๋“œ

โœ… 1. location.assign(url)์ง€์ •ํ•œ URL๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.๋ธŒ๋ผ์šฐ์ € ํžˆ์Šคํ† ๋ฆฌ์— ํ˜„์žฌ ํŽ˜์ด์ง€๊ฐ€ ๋‚จ์Šต๋‹ˆ๋‹ค (๋’ค๋กœ๊ฐ€๊ธฐ ๊ฐ€๋Šฅ).location.href = url๊ณผ ๋™์ผํ•œ ๋™์ž‘์ž…๋‹ˆ๋‹ค.location.assign("/login"); // ์ด๋™ + ๋’ค๋กœ๊ฐ€๊ธฐ ๊ฐ€๋Šฅ โœ… 2. location.replace(url)์ง€์ •ํ•œ URL๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.ํžˆ์Šคํ† ๋ฆฌ์— ํ˜„์žฌ ํŽ˜์ด์ง€๋ฅผ ๋‚จ๊ธฐ์ง€ ์•Š์Šต๋‹ˆ๋‹ค (๋’ค๋กœ๊ฐ€๊ธฐ ๋ถˆ๊ฐ€).๋กœ๊ทธ์ธ ํ›„ ๋ฆฌ๋””๋ ‰์…˜ ๋“ฑ์— ์ž์ฃผ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.location.replace("/login"); // ์ด๋™ + ํ˜„์žฌ ํŽ˜์ด์ง€๋ฅผ ํžˆ์Šคํ† ๋ฆฌ์—์„œ ์ œ๊ฑฐโœ… 3. location.reload()ํ˜„์žฌ ํŽ˜์ด์ง€๋ฅผ ์ƒˆ๋กœ๊ณ ์นจํ•ฉ๋‹ˆ๋‹ค.์บ์‹œ ์—†์ด ์ƒˆ๋กœ๊ณ ์นจํ•˜๋ ค๋ฉด location.reload(true) (์ผ๋ถ€ ๋ธŒ๋ผ์šฐ์ €์—์„œ๋Š” ๋ฌด์‹œ๋จ)location..

Front/JS & jQuery 2025.07.15

[js] location ์†์„ฑ๋ณ„ ์„ค๋ช…

์†์„ฑ ์„ค๋ช…์˜ˆ์‹œ (https://example.com/customer/page.html?page=1#section1)location.href์ „์ฒด URL ๋ฌธ์ž์—ด (์ฝ๊ธฐ/์“ฐ๊ธฐ ๊ฐ€๋Šฅ)"https://example.com/customer/page.html?page=1#section1"location.originํ”„๋กœํ† ์ฝœ + ํ˜ธ์ŠคํŠธ + ํฌํŠธ ๋ฒˆํ˜ธ"https://example.com"location.pathnameํ˜ธ์ŠคํŠธ ๋’ค์˜ ๊ฒฝ๋กœ ๋ถ€๋ถ„"/customer/page.html"location.search์ฟผ๋ฆฌ ๋ฌธ์ž์—ด (๋ฌผ์Œํ‘œ ํฌํ•จ)"?page=1"location.hashํ•ด์‹œ(anchor) (์ƒต ํฌํ•จ)"#section1"location.protocolํ”„๋กœํ† ์ฝœ"https:"location.hostnameํ˜ธ์ŠคํŠธ ์ด๋ฆ„(๋„๋ฉ”์ธ)"e..

Front/JS & jQuery 2025.07.14

[js] location.origin

location.origin์€ ํ˜„์žฌ ์›น ํŽ˜์ด์ง€์˜ **๊ธฐ๋ณธ URL(= ์ถœ์ฒ˜, origin)**์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค.์ฆ‰, ํ”„๋กœํ† ์ฝœ + ํ˜ธ์ŠคํŠธ + ํฌํŠธ ๋ฒˆํ˜ธ๋กœ ๊ตฌ์„ฑ๋œ ๋ฌธ์ž์—ด์ž…๋‹ˆ๋‹ค. โœ… location.origin ๊ตฌ์„ฑ ์š”์†Œ๊ตฌ์„ฑ ์š”์†Œ ์˜ˆ์‹œ location.protocol"https:" ๋˜๋Š” "http:"location.hostname"example.com" ๋˜๋Š” "localhost"location.port":8080" (ํฌํŠธ๊ฐ€ ์žˆ์„ ๊ฒฝ์šฐ)์ „์ฒด ์กฐํ•ฉ (origin)"https://example.com" ๋˜๋Š” "http://localhost:8080" โœ… ์˜ˆ์‹œ์˜ˆ 1: ๊ธฐ๋ณธ ํฌํŠธURL: https://example.com/path/page.htmllocation.origin // "https://example.com"..

Front/JS & jQuery 2025.07.10

[js] navigator.clipboard.writeText()

๋ธŒ๋ผ์šฐ์ €์—์„œ ํ…์ŠคํŠธ๋ฅผ ํด๋ฆฝ๋ณด๋“œ(๋ณต์‚ฌ ์˜์—ญ)**์— ์ €์žฅํ•˜๋Š” ํ‘œ์ค€ JavaScript API์ž…๋‹ˆ๋‹ค. โœ… ๊ธฐ๋ณธ ์„ค๋ช…navigator.clipboard.writeText(text) text: ๋ณต์‚ฌํ•  ๋ฌธ์ž์—ด์ด ๋ฉ”์„œ๋“œ๋Š” Promise๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.๋ณต์‚ฌ๊ฐ€ ์„ฑ๊ณตํ•˜๋ฉด .then()์ด ํ˜ธ์ถœ๋˜๊ณ , ์‹คํŒจํ•˜๋ฉด .catch()์—์„œ ์˜ค๋ฅ˜๋ฅผ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค.โœ… ์˜ˆ์‹œnavigator.clipboard.writeText("https://example.com") .then(() => { alert("ํด๋ฆฝ๋ณด๋“œ์— ๋ณต์‚ฌ๋˜์—ˆ์Šต๋‹ˆ๋‹ค!"); }) .catch(err => { alert("๋ณต์‚ฌ ์‹คํŒจ: " + err); });

Front/JS & jQuery 2025.07.09

[jQuery] .is()

โœ… .is() ๋ฌธ๋ฒ•$(selector).is(selectorOrFunction) selectorOrFunction: CSS ์„ ํƒ์ž, DOM ์š”์†Œ, jQuery ๊ฐ์ฒด, ๋˜๋Š” ํ•จ์ˆ˜๋ฐ˜ํ™˜๊ฐ’: true ๋˜๋Š” false ๐Ÿ“Œ .is() ์˜ˆ$('.box').each(function() { if ($(this).is('.box')) { console.log('์ด ์š”์†Œ๋Š” box ํด๋ž˜์Šค์ž…๋‹ˆ๋‹ค.'); }}); .is('.box'): ์ž์‹ ์ด .box ํด๋ž˜์Šค์ธ์ง€ ํ™•์ธ

Front/JS & jQuery 2025.07.08

[jQuery] .has()

jQuery์˜ .has()๋Š” ์„ ํƒ๋œ ์š”์†Œ ์ง‘ํ•ฉ ์ค‘์—์„œ ํŠน์ • ์ž์‹์„ ํฌํ•จํ•˜๋Š” ์š”์†Œ๋งŒ ํ•„ํ„ฐ๋งํ•˜๋Š” ๋ฉ”์„œ๋“œ์ž…๋‹ˆ๋‹ค.๐Ÿ“Œ ๋ฌธ๋ฒ•$(selector).has(selectorOrElement) selectorOrElement: ํŠน์ • ์ž์‹ ์š”์†Œ(selector) ๋˜๋Š” DOM ์š”์†Œ๋ฅผ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค.๋ฐ˜ํ™˜๊ฐ’: ํ•ด๋‹น ์ž์‹ ์š”์†Œ๋ฅผ ํฌํ•จํ•˜๊ณ  ์žˆ๋Š” ์ƒ์œ„ ์š”์†Œ๋งŒ ๋ฐ˜ํ™˜ํ•˜๋Š” ์ƒˆ๋กœ์šด jQuery ๊ฐ์ฒด์ž…๋‹ˆ๋‹ค.โœ… ์˜ˆ์ œ 1: ํŠน์ • ์ž์‹ ์š”์†Œ๋ฅผ ๊ฐ€์ง„ ๋ถ€๋ชจ ํ•„ํ„ฐ๋ง Apple Banana Cherry $('li').has('span').css('color', 'red');๐Ÿ“Œ ๊ฒฐ๊ณผ: ์š”์†Œ ์ค‘ ์„ ์ž์‹์œผ๋กœ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ์š”์†Œ๋งŒ ๋นจ๊ฐ„์ƒ‰์œผ๋กœ ๋ฐ”๋€œ์ฆ‰, 2๋ฒˆ์งธ์™€ 3๋ฒˆ์งธ ๋งŒ ์„ ํƒ๋จ โœ… ์˜ˆ์ œ 2: ํŠน์ • DOM ์š”์†Œ๊ฐ€ ์ž์‹์œผ๋กœ ์žˆ๋Š”์ง€ ํ™•์ธ$('#parent1, #p..

Front/JS & jQuery 2025.07.07

[html] href์†์„ฑ # / javascript:void(0) ์ฐจ์ด

ํ•ญ๋ชฉ #javascript:void(0)์˜๋ฏธํ˜„์žฌ ํŽ˜์ด์ง€ ์ตœ์ƒ๋‹จ ์ด๋™JS ์ฝ”๋“œ ์‹คํ–‰ ํ›„ ์•„๋ฌด๊ฒƒ๋„ ํ•˜์ง€ ์•Š์Œ๊ธฐ๋ณธ ๋™์ž‘ํŽ˜์ด์ง€ ์ตœ์ƒ๋‹จ์œผ๋กœ ์Šคํฌ๋กค ์ด๋™์—†์ŒpreventDefault ํ•„์š” ์—ฌ๋ถ€ํ•„์š” (evt.preventDefault())๋ถˆํ•„์š”SEO ์นœํ™”๋„๋น„๊ต์  ๋‚˜์จ (๋นˆ ๋งํฌ)๋” ๋‚˜์จ (JS ์ง์ ‘ ์‚ฌ์šฉ์€ ๊ถŒ์žฅ ์•ˆ ๋จ)์•ˆ์ •์„ฑ/์ง๊ด€์„ฑ์ค‘๊ฐ„ (์ œ๋Œ€๋กœ ๋ง‰์ง€ ์•Š์œผ๋ฉด ๋ฌธ์ œ)๋” ์•ˆ์ „ํ•˜๊ฒŒ ์ด๋ฒคํŠธ๋งŒ ์‹คํ–‰ ๊ฐ€๋Šฅ โœ… ์™œ href="javascript:void(0)"์€ SEO์— ์•ˆ ์ข‹์„๊นŒ?๋งํฌ๋กœ์จ ์˜๋ฏธ ์žˆ๋Š” ๋ชฉ์ ์ง€๊ฐ€ ์—†๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.๊ฒ€์ƒ‰ ๋กœ๋ด‡์ด "์ด๊ฑด ํด๋ฆญํ•ด๋„ ๊ฐˆ ๊ณณ์ด ์—†๋Š” ๋งํฌ๋„ค"๋ผ๊ณ  ํŒ๋‹จํ•ฉ๋‹ˆ๋‹ค.๋‚ด๋ถ€ ๋งํฌ ๊ตฌ์กฐ๋ฅผ ํŒŒ์•…ํ•˜์ง€ ๋ชปํ•˜๋ฉด ํŽ˜์ด์ง€ ๋žญํฌ ์ „๋‹ฌ, ์ƒ‰์ธ ๋“ฑ๋ก ๋“ฑ SEO ์ ์ˆ˜๊ฐ€ ๋‚ฎ์•„์ง‘๋‹ˆ๋‹ค.์ฆ‰, a ํƒœ๊ทธ๋Š” ์‹ค์ œ๋กœ ์ด๋™ํ•  ์ฝ˜ํ…์ธ ๊ฐ€ ์žˆ์„ ๋•Œ๋งŒ..

Front/HTML 2025.07.06
728x90
๋ฐ˜์‘ํ˜•