Spring 33

[Spring] javax.servlet.ServletException: No adapter for handler ํ•ด๊ฒฐ๋ฐฉ๋ฒ•

javax.servlet.ServletException: No adapter for handler [org.springframework.web.socket.server.support.WebSocketHttpRequestHandler@69ccfce9]: The DispatcherServlet configuration needs to include a HandlerAdapter that supports this handler @Controller public class MainController { @EnableWebMvc ์ถ”๊ฐ€ํ•˜๊ธฐ @Controller @EnableWebMvc public class MainController {

Spring 2021.11.10

[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

[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

๋กœ๊ทธ์ธ ์–‘๋ฐฉํ–ฅ ์•”ํ˜ธํ™”(RSA) ๋‹จ๋ฐฉํ–ฅ ์•”ํ˜ธํ™”(SHA 256) ์‚ฌ์šฉํ•˜๊ธฐ

์–‘๋ฐฉํ–ฅ ์•”ํ˜ธํ™”(RSA) ๋‹จ๋ฐฉํ–ฅ ์•”ํ˜ธํ™”(SHA 256) ์ฐจ์ด RSA SHA 256 ์–‘๋ฐฉํ–ฅ ์•”ํ˜ธํ™” = ๋ณตํ˜ธํ™”๊ฐ€ ๊ฐ€๋Šฅํ•˜๋‹ค. ๋‹จ๋ฐฉํ–ฅ ์•”ํ˜ธํ™” = ๋ณตํ˜ธํ™”๊ฐ€ ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹ค. ์‚ฌ์šฉ์ž๋Š” ๊ณต๊ฐœ๋œ ํ‚ค์™€ ์ž์‹ ๋งŒ ์•„๋Š” ๊ฐœ์ธํ‚ค๋ฅผ ๊ฐ€์ง„๋‹ค. hash ํ•จ์ˆ˜์˜ ์ผ์ข… ๊ณต๊ฐœํ‚ค, ๊ฐœ์ธํ‚ค๋กœ ์•”ํ˜ธํ™”/๋ณตํ˜ธํ™”๋ฅผ ํ•˜๋Š” ์‹œ์Šคํ…œ SHA ์•Œ๊ณ ๋ฆฌ์ฆ˜์˜ ํ•œ ์ข…๋ฅ˜๋กœ 256๋น„ํŠธ๋กœ ๊ตฌ์„ฑ 64์ž๋ฆฌ ๋ฌธ์ž์—ด์„ ๋ฐ˜ํ™˜ ํ‚ค์ƒ์„ฑ - ํ‚ค๋ถ„๋ฐฐ - ์•”ํ˜ธํ™” - ๋ณตํ˜ธํ™” ์ˆœ์œผ๋กœ ์ด๋ฃจ์–ด์ง. ๋ณตํ˜ธํ™”๋ฅผ ํ•˜์ง€ ์•Š์•„๋„ ๋˜ ์†๋„๊ฐ€ ๋น ๋ฅด๋‹ค. web(JSP) -> server(controller)๋กœ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ๋ณด๋‚ผ ๋•Œ ์ค‘๊ฐ„์—์„œ ์ •๋ณด๋ฅผ ๊ฐ€๋กœ์ฑŒ ์ˆ˜ ์žˆ๋‹ค. ์ด๋Ÿฌํ•œ ๋ณด์•ˆ ๋ฌธ์ œ๋ฅผ ๋ง‰๊ธฐ ์œ„ํ•ด JSP์—์„œ RSA๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์•”ํ˜ธํ™”ํ•ด์ค€๋‹ค.. RSA๋กœ ์•”ํ˜ธํ™”๋œ ํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ controller์—์„œ ๋ณตํ˜ธํ™”์‹œํ‚ค๊ณ , ๋ณตํ˜ธ..

Spring 2021.09.03

[Spring Error] Can not find the tag library descriptor for

Can not find the tag library descriptor for ๋˜๋Š” The import javax.servlet cannot be resolved ์˜ค๋ฅ˜๋ฅผ ํ•ด๊ฒฐํ•ด๋ณด์ž. project ์šฐํด๋ฆญ - Build Path - Configure Build Path * Apache Tomcat v7.0์˜ Server Library๋ฅผ ํฌํ•จํ•˜๋Š”๋ฐ ํ˜„์žฌ ์ดํด๋ฆฝ์Šค์—๋Š” ํ†ฐ์บฃ 7 ์„œ๋ฒ„๊ฐ€ ๋“ฑ๋ก๋˜์–ด ์žˆ์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— unbound๋ผ๊ณ  ํ‘œ์‹œ. Server Library ๋”๋ธ” ํด๋ฆญ - Tomcat server runtime library ์ถ”๊ฐ€ unbound ํ‘œ์‹œ๊ฐ€ ์‚ฌ๋ผ์ง€๊ณ  ํŽผ์ณ๋ณด๋ฉด tomcat Library๋“ค์ด build path์— ์ถ”๊ฐ€๋จ. Apply ํด๋ฆญ ๊ฒฐ๊ณผ ํ™•์ธ

Spring 2021.08.31

[JAVA] Lamda ํ‘œํ˜„์‹ ์˜ˆ์ œ

Lamda ํ‘œํ˜„์‹ ๋žŒ๋‹ค์‹์€ JAVA 8์— ๋„์ž…๋œ ํ•จ์ˆ˜(๋ฉ”์„œ๋“œ)๋ฅผ ๊ฐ„๋‹จํ•œ ์‹์œผ๋กœ ํ‘œํ˜„ํ•˜๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ ์ต๋ช… ํ•จ์ˆ˜(anonymous function)๋ฅผ ์ƒ์„ฑํ•˜๊ธฐ ์œ„ํ•œ ์‹์ด๋‹ค. ๊ฐ์ฒด ์ง€ํ–ฅ ์–ธ์–ด๋ณด๋‹ค๋Š” ํ•จ์ˆ˜ ์ง€ํ–ฅ ์–ธ์–ด์— ๊ฐ€๊น๋‹ค. ํ•จ์ˆ˜ ๋ฉ”์„œ๋“œ ํด๋ž˜์Šค์— ๋…๋ฆฝ์  ํด๋ž˜์Šค์— ์ข…์†์  ์ผ๋ฐ˜์ ์ธ ์šฉ์–ด ๊ฐ์ฒด์ง€ํ–ฅ ๊ฐœ๋… ์šฉ์–ด Lamda์‹ ๊ธฐ๋ณธ ์ž‘์„ฑ ๋ฐฉ๋ฒ• (์ธ์ˆ˜) -> {์ฒ˜๋ฆฌ} ()-> {์ฒ˜๋ฆฌ} (์ธ์ˆ˜) -> ์ฒ˜๋ฆฌ (์ธ์ˆ˜) -> {return 0;} int max(int a, int b) { retrun a > b ? a : b; } ↓ ๋ฉ”์„œ๋“œ์˜ ์ด๋ฆ„๊ณผ ๋ฐ˜ํ™˜ ํƒ€์ž…์„ ์ œ๊ฑฐ ํ›„ ' -> ' ์ถ”๊ฐ€ (a, b) -> a > b ? a : b List์—์„œ Lamda์‚ฌ์šฉ Java 7 ์ดํ•˜ : for๋ฌธ ์‚ฌ์šฉ List list = ...service...

Spring 2021.08.27

[MAVEN] java.util.zip.ZipException: invalid LOC header (bad signature) ์˜ค๋ฅ˜

์›์ธ : maven jar ํŒŒ์ผ์ด ๊นจ์ง„๊ฒƒ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• 1. Eclipse close 2. C:\Users\.m2 ์ ‘์† -> repository ํด๋”๋ฅผ ์‚ญ์ œ * ํ˜น์‹œ ๋ชจ๋ฅด๋‹ˆ repository ํด๋” ๋ฐฑ์—…์„ ํ•ด๋†“์ž. 3. ํ•ด๋‹น ํ”„๋กœ์ ํŠธ ์šฐํด๋ฆญ - Maven - Update Project (= ์ •์ƒ์ ์ธ jar๋กœ ๊ต์ฒดํ•˜๋Š” ์ž‘์—…) 4. ์žฌ์‹œ์ž‘

Spring 2021.08.12

[JXLS] jx:if(condition ์›ํ•˜๋Š” ์…€ ์ƒ‰์ƒ ๋ณ€๊ฒฝํ•˜๊ธฐ

JXLS if๋ฌธ์„ ์‚ฌ์šฉํ•ด์„œ ์›ํ•˜๋Š” ๋ถ€๋ถ„ ์…€ ์ƒ‰์ƒ์„ ๋ณ€๊ฒฝํ•ด๋ณด์ž. [JAVA] JXLS ์—‘์…€ ๋‹ค์šด๋กœ๋“œ JXLS = JXLS์€ ํ…œํ”Œ๋ฆฟ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ์ตœ์ข… ์—‘์…€ํŒŒ์ผ์„ ์ƒ์„ฑ ๋ฐ์ดํ„ฐ (java ๊ฐ์ฒด) + ์—‘์…€ ํ…œํ”Œ๋ฆฟ = ์—‘์…€๊ฒฐ๊ณผ ์ถœ๋ ฅ ์—‘์…€์„ ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์—‘์…€์˜ ์„œ์‹, ์ฐจํŠธ, ์ˆ˜์‹๋“ฑ์„ ๋„ฃ์„ ์ˆ˜ ์žˆ๋‹ค. pom.xml org.apache. truecode-95.tistory.com JXLS - If-Command Introduction If-Command is a conditional command to output an area depending on a condition specified in the test attribute of the command. Command Attributes The If-Comm..

Spring 2021.08.11

[JXLS] JXLS EXCEL Templates์— ๊ทธ๋ฃน์„ ์—ฌ๋Ÿฌ ๊ฐœ ์‚ฌ์šฉ ์—‘์…€ ๋‹ค์šด๋กœ๋“œ์‹œ ๋ฐœ์ƒํ–ˆ๋˜ ์ด์Šˆ

[JAVA] JXLS ์—‘์…€ ๋‹ค์šด๋กœ๋“œ JXLS = JXLS์€ ํ…œํ”Œ๋ฆฟ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ์ตœ์ข… ์—‘์…€ํŒŒ์ผ์„ ์ƒ์„ฑ ๋ฐ์ดํ„ฐ (java ๊ฐ์ฒด) + ์—‘์…€ ํ…œํ”Œ๋ฆฟ = ์—‘์…€๊ฒฐ๊ณผ ์ถœ๋ ฅ ์—‘์…€์„ ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์—‘์…€์˜ ์„œ์‹, ์ฐจํŠธ, ์ˆ˜์‹๋“ฑ์„ ๋„ฃ์„ ์ˆ˜ ์žˆ๋‹ค. pom.xml org.apache. truecode-95.tistory.com Controller JXLS EXCEL Templates์— ๊ทธ๋ฃน์„ ์—ฌ๋Ÿฌ ๊ฐœ ์‚ฌ์šฉํ•˜๋ฉด [BK] cell ์ดํ›„ ๊ทธ๋ฃน์œผ๋กœ ๋ฌถ์€ ๊ฐ’๋“ค์€ ๋‚˜์˜ค์ง€ ์•Š๋Š”๋‹ค. Map m0 = new HashMap(); m0.put("list", list); m0.put("title","์ œ๋ชฉ1"); Map m1 = new HashMap(); m1.put("list", list1); m1.put("title","์ œ๋ชฉ2"); Lis..

Spring 2021.08.04