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

์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ50

Web - Servlet ์‹ค์Šต index (client) servlet ๊ธฐ๋ณธ xml์— sevlet ์ง€์ • helloServlet sample01.HelloServlet helloServlet /location HelloServlet package sample01; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class HelloServlet extends HttpServlet { @Override protected v.. 2021. 3. 14.
Web - 1๏ธโƒฃ Servlet์ด๋ž€ Servlet์˜ ๊ฐœ๋…๊ณผ ๋™์ž‘ ๊ณผ์ •์„ ์ดํ•ดํ•œ๋‹ค. Goal Web Service์˜ ๊ธฐ๋ณธ์ ์ธ ๋™์ž‘ ๊ณผ์ •์„ ์ดํ•ดํ•œ๋‹ค. ์‚ฌ์šฉ์ž ์ž…๋ ฅ์„ ์œ„ํ•œ HTML Form์„ ์ดํ•ดํ•œ๋‹ค. Servlet์„ ์ดํ•ดํ•œ๋‹ค. Web Service์˜ ๊ธฐ๋ณธ์ ์ธ ๋™์ž‘ ๊ณผ์ • HTML Form -> Servlet -> HTML Page 1. ์‚ฌ์šฉ์ž๊ฐ€ ์›น ํŽ˜์ด์ง€ form(HTML Form)์„ ํ†ตํ•ด ์ž์‹ ์˜ ์ •๋ณด๋ฅผ ์ž…๋ ฅํ•œ๋‹ค. (Input) 2. Servlet์˜ doGet() ๋˜๋Š” doPost() ๋ฉ”์„œ๋“œ๋Š” ์ž…๋ ฅํ•œ form data์— ๋งž๊ฒŒ DB ๋˜๋Š” ๋‹ค๋ฅธ ์†Œ์Šค์—์„œ ๊ด€๋ จ๋œ ์ •๋ณด๋ฅผ ๊ฒ€์ƒ‰ํ•œ๋‹ค. 3. ์ด ์ •๋ณด๋ฅผ ์ด์šฉํ•˜์—ฌ ์‚ฌ์šฉ์ž์˜ ์š”์ฒญ์— ๋งž๋Š” ์ ์ ˆํ•œ ๋™์  ์ปจํ…์ธ (HTML Page)๋ฅผ ๋งŒ๋“ค์–ด์„œ ์ œ๊ณตํ•œ๋‹ค. (Output) HTML Form input elements(Ex.. 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.
2๏ธโƒฃ ์ œ์ด์Šจ JSON - ๋ฐ์ดํ„ฐ ๊ฐ€์ ธ์˜ค๊ธฐ Json ํŒŒ์ผ-> data.json [ { "name":"์ •์ˆ˜๋™", "age":23, "address":"์„œ์šธ์‹œ", "height":181.1 }, { "name":"์‹ฌ์ฒญ์ด", "age":14, "address":"๊ฐ•์›์‹œ", "height":165.3 }, { "name":"ํ–ฅ๋‹จ์ด", "age":16, "address":"๋‚จ์›์‹œ", "height":157.9 }, { "name":"์ด๋ชฝ๋ฃก", "age":18, "address":"๊ณต์ฃผ์‹œ", "height":173.7 } ] 2021. 3. 9.