๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

jsp39

JSP - 1. ๋‚ด์žฅ๊ฐ์ฒด (Parameter) ๋กœ ๋ฐ์ดํ„ฐ ๋ฐ›์•„ ์ „์†ก request.setCharacterEncoding("utf-8"); ์ธ์ฝ”๋”ฉ์„ค์ • ๋‚ด์žฅ๊ฐ์ฒด 4๊ฐ€์ง€ request getParameter -๊ฐ’์„ ๋ฐ›์„ ๋•Œ getParameterValues -๊ฐ’๋“ค์„ ๋ฐ›์„ ๋Œ€ setAttribute -์ง์Œ€๋•Œ(๊ฐ์ฒด๋ฅผ ์ €์žฅํ•œ๋‹ค) getAttribute -์งํ’€์–ด YouClass cls = new YouClass("์ฃผ์ง€ํ›ˆ"); //์ง์‹ธ! //๋‚ด์žฅ๊ฐ์ฒด //1 ๋ฒˆ์งธ request.setAttribute("you", cls); Object obj = request.getAttribute("you"); //Object obj = session.getAttribute("you"); YouClass ycls = null; if(obj != null){ ycls = (YouClass)obj; } .. 2021. 3. 15.
JSP (java server page)๋ž€? jsp (javaServer Pages) HTML ์ฝ”๋“œ์— ์ž๋ฐ” ์ฝ”๋“œ๋ฅผ ๋„ฃ์–ด ๋™์  ์›นํŽ˜์ด์ง€๋ฅผ ์ƒ์„ฑํ•˜๋Š” ์›น ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋„๊ตฌ์ด๋‹ค jsp ์‹คํ–‰ -> ์ž๋ฐ” ์„œ๋ธ”๋ฆฟ์œผ๋กœ ๋ณ€ํ™˜ - > ์›น ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ์„œ๋ฒ„์— ๋™์ž‘ -> ์ƒ์„ฑ๋œ ๋ฐ์ดํ„ฐ๋ฅผ ์›นํŽ˜์ด์ง€์™€ ํ•จ๊ป˜ ํด๋ผ์ด์–ธํŠธ๋กœ ์‘๋‹ต WEB ์›น์ด๋ž€ ์ธํ„ฐ๋„ท ๊ธฐ๋ฐ˜์˜ ์ •๋ณด๊ธฐ์ˆ  ์ •๋ณด์˜ ํ๋ฆ„ ๊ณต์œ  ์›น ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ์‚ฌ์šฉ์ž๊ฐ€ ํ•„์š”ํ•œ ์š”์ฒญ(Request)๋ฅผ ํ•˜๊ณ  ์„œ๋ฒ„์—์„œ๋Š” ์ด์— ํ•ด๋‹นํ•˜๋Š” ์š”์ฒญ์„ ์ˆ˜ํ–‰ํ•˜๊ณ  ์š”์ฒญํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ์‘๋‹ต (reponse) ์›น ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์œ„์™€ ๊ฐ™์ด ๋™์ž‘ํ•˜๊ธฐ ์œ„ํ•œ ๋ช‡๊ฐ€์ง€ ๊ตฌ์„ฑ์š”์†Œ๊ฐ€ ์žˆ๋‹ค. ์›น ๋ธŒ๋ผ์šฐ์ €(Web Browser) : ํด๋ผ์ด์–ธํŠธ์—์„œ ์š”์ฒญ์„ ํ•˜๊ณ  ์ „๋‹ฌ๋ฐ›์€ ํŽ˜์ด์ง€๋ฅผ ๋ณผ์ˆ˜์žˆ๋Š” ํ™˜๊ฒฝ์„ ๋งํ•œ๋‹ค. ( ํฌ๋กฌ, IE, Safari, Firefox ๋“ฑ.. ) ์›น ์„œ๋ฒ„(Web Serve.. 2021. 3. 15.
Web - Servlet ์‹ค์Šต 2 (ํด๋ผ์ด์–ธํŠธ ๋ฐ์ดํ„ฐ -> ์„œ๋ฒ„๋กœ ๋„˜๊ฒจ์ฃผ๊ธฐ) index.html Servlet xml servlet ๋“ฑ๋ก servlet์€ ๋‘๊ฐœ๋กœ ๋“ฑ๋กํ•œ๋‹ค hello, sample ์•„๋ž˜ ์ฝ”๋“œ๋Š” javaEE๋กœ ๋ถˆ๋Ÿฌ์˜จ๋‹ค.(xml)์ž๋™ ์ƒ์„ฑ ์„œ๋ธŒ๋ฆฟ์ด๋ฆ„๋ช…์€ hello๋กœ ์ง€์ • ํด๋ž˜์Šค๋Š” hello.HelloServlet ์ด๊ธฐ๋•Œ๋ฌธ์— ์„œ๋ฒ„์—์„œ ์ž๋ฐ” ํด๋ž˜์Šค ๋ช…๋ น์„ ๋ฐ›์•„์„œ ์‹คํ–‰๋œ๋‹ค. sample03 index.html index.htm index.jsp default.html default.htm default.jsp hello hello.HelloServlet hello /loc sample sam.SampleServlet sample /sample hello.HelloServlet package hello; import java.io.IOException; import java... 2021. 3. 14.
4๏ธโƒฃ ์ œ์ด์Šจ JSON - ์ž๊ธฐ๊ฐ€ ์ข‹์•„ํ•˜๋Š”์ฑ… 5๊ฐ€์ง€ ํ…Œ์ด๋ธ” ์‹œ๊ฐํ™” XML+ ์ฝ”๋“œ ํŽผ์น˜๊ธฐ -> ๋”๋ณด๊ธฐ books.xml ์ฝ”๋“œ ํŽผ์น˜๊ธฐ -> ๋”๋ณด๊ธฐ Lord of the ring jf.tolkin 12$ Harry Porter Joanne Rowling 20$ The little Prince Saint-Exupéry 9$ And Then There Were None Agatha Christie 16$ The Da Vinci Code Dan Brown 30$ 2021. 3. 9.