์๋ธ๋ฆฟ7 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. 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. ์ด์ 1 2 ๋ค์