Category 192

[JavaScript] input Box ์ž๋™ submit ๋ง‰๋Š” ๋ฐฉ๋ฒ• 3๊ฐ€์ง€

input Box๊ฐ€ ํ•˜๋‚˜์ด๊ณ , ๊ฐ’์„ ์ž…๋ ฅ ํ›„ enterํ‚ค๋ฅผ ๋ˆ„๋ฅด๋ฉด submit์ด ๋ผ๋ฒ„๋ฆฌ๋Š” ํ˜„์ƒ์ด ์ƒ๊ฒผ๋‹ค. ์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•œ ๋ฐฉ๋ฒ• 3๊ฐ€์ง€๋ฅผ ์ ์–ด๋ณด๋ ค๊ณ  ํ•œ๋‹ค. 1. input Box๋ฅผ ํ•˜๋‚˜๋” ์ƒ์„ฑํ•œ๋‹ค. style๋กœ ์ˆจ๊ธฐ๊ธฐ. ์›๋ž˜์˜ ์†Œ์Šค์— style display:none์ธ input์„ ์ถ”๊ฐ€ํ•ด์ค€๋‹ค. * type์€ text * display:none - ์•„์˜ˆ ์‚ฌ๋ผ์ง€๊ฒŒ ํ•˜๋Š” ๊ฒƒ. ๋ณด์ด์ง€๋„ ์•Š๊ณ  ํ•ด๋‹น ๊ณต๊ฐ„๋„ ์กด์žฌํ•˜์ง€ X visibility:hidden - ๋ณด์ด์ง€๋งŒ ์•Š๊ณ  ํ•ด๋‹น ๊ณต๊ฐ„์€ ์กด์žฌ. width์™€ height๊ฐ’์„ ์ฃผ์—ˆ๋‹ค๋ฉด ๊ทธ๋งŒํผ ๊ณต๊ฐ„์€ ์กด์žฌ 2. keycode๊ฐ’์„ ํŒ๋‹จํ•ด์„œ ์ฒ˜๋ฆฌํ•ด์ค€๋‹ค. (์ถ”์ฒœ) preventDefault : ๋ธŒ๋ผ์šฐ์ € ๊ณ ์œ ์˜ ๋™์ž‘์„ ์ค‘๋‹จ stopPropagation : ๋ถ€๋ชจ ์—˜๋ฆฌ๋จผํŠธ์—๊ฒŒ ์ด..

js 2021.11.04

[JAVA] java.lang.Integer cannot be cast to java.lang.String ํ˜•๋ณ€ํ™˜ ์˜ค๋ฅ˜ ํ•ด๊ฒฐํ•˜๊ธฐ

mybatis์—์„œ resultType์ด HashMap์ด๊ณ , intํ˜•์ธ b_no์˜ ๊ฐ’์„ Stringํ˜•์œผ๋กœ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด ๊ฐ•์ œ๋กœ ํ˜•๋ณ€ํ™˜์‹œ ๋ฐœ์ƒํ•˜๋Š” ์˜ค๋ฅ˜ String b_no = (String) info.get("b_no"); ์บ์ŠคํŒ… ํ˜•๋ณ€ํ™˜์ด์•„๋‹Œ String ํด๋ž˜์Šค์˜ valueOf(Object)๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์˜ค๋ฅ˜๋ฅผ ํ•ด๊ฒฐํ–ˆ๋‹ค. String b_no = String.valueOf(info.get("b_no"));

Spring 2021.10.29

[jQuery] ํŒŒ์ผ ์—…๋กœ๋“œ input type = 'file' ๋‹ค์ค‘์œผ๋กœ ์ƒ์„ฑํ•˜๊ธฐ

html ์ถ”๊ฐ€ js var maxAppend = 1; $('.__add ._add').on('click',function(){ if(maxAppend >= 3){ alert("ํŒŒ์ผ ์—…๋กœ๋“œ ์ตœ๋Œ€ ๊ฐœ์ˆ˜๋Š” 3๊ฐœ ์ž…๋‹ˆ๋‹ค."); return; }else{ $('.__add').append(' ์‚ญ์ œ'); maxAppend ++; } }); function addDel(a){ $(a).closest('li').remove(); maxAppend --; }

js 2021.10.26

[jQuery] ๋™์  ์ถ”๊ฐ€๋œ append์— click event ์ฒ˜๋ฆฌ

append ํ•œ button์— ํด๋ฆญ์ด๋ฒคํŠธ๋ฅผ ์ฃผ๋‹ˆ ์ด๋Ÿฐ ์˜ค๋ฅ˜ ๋ฉ”์‹œ๊ฐ€ ์ถœ๋ ฅ. (index):1 Uncaught ReferenceError: ํ•จ์ˆ˜๋ช… is not defined at HTMLButtonElement.onclick ((index):1) ์›์ธ : ๋™์ ์œผ๋กœ ์ถ”๊ฐ€๋œ ํƒœ๊ทธ๋Š” ์ด๋ฒคํŠธ๊ฐ€ ๋™์ž‘๋˜์ง€ ์•Š์Œ. = ๋กœ๋“œ๋˜์—ˆ์„ ๋•Œ ์กด์žฌํ•˜์ง€ ์•Š๋Š” ํƒœ๊ทธ์— ๋Œ€ํ•ด์„œ๋Š” ์ด๋ฒคํŠธ๋ฅผ ๊ฑธ ์ˆ˜ ์—†๋Š” ๊ฒƒ $(document).on('click / change ๋“ฑ๋“ฑ์˜ ์ด๋ฒคํŠธ', '์ด๋ฒคํŠธ ์ ์šฉํ•  ํƒ€๊นƒ ํƒœ๊ทธ', ๋™์ž‘ ํ•จ์ˆ˜(){}); ๋˜๋Š” $('.๋ถ€๋ชจ ์ด๋ฆ„').on('click', '.๊ฑธ๊ณ  ์‹ถ์€ ๋Œ€์ƒ', function() { ๋„ฃ์„ ์†Œ์Šค; }); ์ถœ์ฒ˜ : https://stackoverflow.com/questions/15420558/jquer..

js 2021.10.26

[AJAX] ๋‹ค์ค‘ fileupload / formData ์ด์šฉํ•˜์—ฌ JSON ํŒŒ๋ผ๋ฏธํ„ฐ ๋„˜๊ธฐ๊ธฐ & ํŒŒ์ผ์—…๋กœ๋“œ ๊ตฌํ˜„

[jQuery] ํŒŒ์ผ ์—…๋กœ๋“œ input type = 'file' ๋‹ค์ค‘์œผ๋กœ ์ƒ์„ฑํ•˜๊ธฐ html ์ถ”๊ฐ€ js var maxAppend = 1; $('.__add ._add').on('click',function(){ if(maxAppend >= 3){ alert("ํŒŒ์ผ ์—…๋กœ๋“œ ์ตœ๋Œ€ ๊ฐœ์ˆ˜๋Š” 3๊ฐœ ์ž…๋‹ˆ๋‹ค."); return; }else{ $('.__add').append(' ์‚ญ์ œ '); maxAppend ++;.. truecode-95.tistory.com html js file์€ JSON์— ํฌํ•จ๋  ์ˆ˜ ์—†๋‹ค. ๊ทธ๋ž˜์„œ FormData ์•ˆ์— file๊ณผ JSON (= data)๋ฅผ append ์‹œํ‚จ๋‹ค. //FormData ์ƒˆ๋กœ์šด ๊ฐ์ฒด ์ƒ์„ฑ var formData = new FormData(); // ๋„˜๊ธธ ๋ฐ์ดํ„ฐ๋ฅผ ๋‹ด์•„์ค€๋‹ค..

js 2021.10.22

[EgovFramework] Spring Interceptor session AJAX ์ฒ˜๋ฆฌ

egov-com-interceptor.xml LoginSessionInterceptor.java preHandle() - ์„ธ์…˜ ๋ฐ ๋กœ๊ทธ์ธ ์ฒดํฌ request -> preHandle -> controller -> postHandle -> afterCompletion -> view ์„ธ์…˜๋งŒ๋ฃŒ ์‹œ ๋กœ๊ทธ์ธํŽ˜์ด์ง€๋กœ ์ด๋™ํ•œ๋‹ค. @return true(์š”์ฒญํ•œ controller ํ˜ธ์ถœ), false(๋กœ๊ทธ์ธํŽ˜์ด์ง€๋กœ ์ด๋™) ์„ธ์…˜ ์œ ํšจํ•˜๋‹ค๋ฉด ๋ฌธ์ œ ์—†์ด Controller๋กœ ํ†ต๊ณผ์‹œ์ผœ๋„ ๋˜๊ธฐ ๋•Œ๋ฌธ์— return true๋ฅผ ํ•ด์ฃผ๊ณ  ์œ ํšจํ•˜์ง€ ์•Š๋‹ค๋ฉด login ํŽ˜์ด์ง€๋กœ redirect ์‹œํ‚จ๋‹ค. public class LoginSessionInterceptor extends HandlerInterceptorAdapter { @Overr..

Spring 2021.10.18

[EgovFramework] context-syslogaop.xml aop Error

egovframework:์‹œ์Šคํ…œ๋กœ๊ทธ์กฐํšŒ [eGovFrame] ์‹œ์Šคํ…œ๋กœ๊ทธ์กฐํšŒ๋Š” ์‹œ์Šคํ…œ ์‚ฌ์šฉ์‹œ ๋ฐœ์ƒํ•˜๋Š” ๊ฐ์ข… ๋กœ๊ทธ๋ฅผ ๊ฒ€์ƒ‰, ์กฐํšŒํ•˜๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•œ๋‹ค. ์‹œ์Šคํ…œ๋กœ๊ทธ์กฐํšŒ๋Š” ์‹œ์Šคํ…œ๋กœ๊ทธ์˜ ๋“ฑ๋ก, ์กฐํšŒ, ๋ชฉ๋ก, ์‚ญ์ œ, ์š”์•ฝ์˜ ๊ธฐ๋Šฅ์„ ์ˆ˜๋ฐ˜ํ•œ๋‹ค. โ‘  ์‹œ์Šคํ…œ๋กœ๊ทธ๋“ฑ๋ก www.egovframe.go.kr egov ๊ณตํ†ต ์ปดํฌ๋„ŒํŠธ์ธ ์‹œ์Šคํ…œ ๋กœ๊ทธ ์กฐํšŒ๋ฅผ ์ ์šฉํ•˜๋‹ค ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๊ฐ€ ์ถœ๋ ฅ๋˜์—ˆ๋‹ค. org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'service๋ช…' is expected to be of type 'egovframework.pcr.main.web.service.service๋ช…' but was actually of type 'co..

Spring 2021.10.12

[PostgreSQL]Error updating database. Cause: org.postgresql.util.PSQLException: ์˜ค๋ฅ˜: ๋ฆด๋ ˆ์ด์…˜(relation) ์ ‘๊ทผ ๊ถŒํ•œ ์—†์Œ

์›์ธ : ํ•ด๋‹น user์— ์ ‘๊ทผ ๊ถŒํ•œ์ด ์—†์–ด์„œ. org.springframework.jdbc.BadSqlGrammarException: ### Error updating database. Cause: org.postgresql.util.PSQLException: ์˜ค๋ฅ˜: ํ…Œ์ด๋ธ”๋ช… ๋ฆด๋ ˆ์ด์…˜(relation) ์ ‘๊ทผ ๊ถŒํ•œ ์—†์Œ ### The error may involve egovframework.com.sym.log.service.impl.EgovLogManageMapper.logInsertSysLog-Inline ### The error occurred while setting parameters USER ์กฐํšŒ select * from PG_SHADOW; ๊ถŒํ•œ ์ข…๋ฅ˜ SELECT ํ…Œ์ด๋ธ”์ด๋‚˜ ๋ทฐ์— ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒ ..

DB 2021.10.08

[iPhone] ์•„์ดํฐ12 3G๋กœ ์žกํž๋•Œ ํ•ด๊ฒฐ๋ฐฉ๋ฒ• (iOS 15.0)

iPhone 12 pro๋ฅผ ์‚ฌ์šฉ ์ค‘์ธ๋ฐ. 2-3์ผ ์ „๋ถ€ํ„ฐ LTE๊ฐ€ ๋จนํ†ต์ด ๋˜๊ฑฐ๋‚˜ ๋„คํŠธ์›Œํฌ๊ฐ€ 3G๋กœ ์žกํžˆ๊ธฐ ์‹œ์ž‘ํ–ˆ๋‹ค. 5G๋ฅผ ์ง€์›ํ•˜๋Š” 12๋ผ์ธ์— 3G๋ผ๋‹ˆ^^ ! ํ•ด๊ฒฐ๋ฐฉ๋ฒ• 1. ์„ค์ •์— ๋“ค์–ด๊ฐ„๋‹ค. 2. ์ „์†ก ๋˜๋Š” iPhone ์žฌ์„ค์ • ํด๋ฆญ. 3. ๋„คํŠธ์›Œํฌ ์„ค์ • ์žฌ์„ค์ • ํด๋ฆญ. 4. ์žฌ๋ถ€ํŒ…๋˜๋ฉด์„œ 3G ๋ฌธ์ œ๊ฐ€ ํ•ด๊ฒฐ๋œ๋‹ค.

iOS 2021.09.24

[JavaScript] .js ํŒŒ์ผ์—์„œ contextPath ๊ตฌํ•˜์—ฌ ์‚ฌ์šฉํ•˜๊ธฐ (sessionStorage)

์ œ์ผ ๊ฐ„ํŽธํ•˜๊ณ  ์ข‹์€ ๋ฐฉ๋ฒ•์€ HTML์ด๋‚˜ JSP์—์„œ EL์ด๋‚˜ , jstl์„ ์‚ฌ์šฉํ•˜์—ฌ pageContext ๊ฐœ์ฒด์—์„œ request ๊ฐ์ฒด์˜ contextPath๋ฅผ ๊ฐ€์ ธ์˜ค๋ฉด ๋œ๋‹ค. EL ${pageContext.request.contextPath} JSP JSTL ์˜ค๋Š˜์€ jsํŒŒ์ผ์—์„œ contextPath ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์ ์–ด๋ณด๋ ค๊ณ  ํ•œ๋‹ค. sessionStorage tiles ์˜์—ญ header.jsp์— ์ถ”๊ฐ€ => sessionStorage์— contextPath๋ฅผ ์ €์žฅ contextPath๋ฅผ ์‚ฌ์šฉํ•  js ํŒŒ์ผ์„ ์—ด์–ด sessionStorage.getItem("contextpath")๋กœ ๊บผ๋‚ด์˜จ๋‹ค. var ctx = getContextPath(); function getContextPath() { return ses..

js 2021.09.23