๊ตญ๋น76 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. Web - Servlet ์ค์ต 4 (form -> ์๋ฒ -> html ์ถ๋ ฅ) HTML index.html method์ ๊ฐ์ผ๋ก๋ ์์ฒญ์ ์ฒ๋ฆฌํ๋ ๋ฐฉ์ ( ex> get, post ) Get : http://IP์ฃผ์:port๋ฒํธ/์ปจํ ์คํธ/path/MemberJoin?id="admin"&name="ํ๊ธธ๋" -> doGet() ํธ์ถ [ ๊ฒฝ๋ก๋ ธ์ถ, ๋ณด์ ์ํ ] Post : http://IP์ฃผ์:port๋ฒํธ/์ปจํ ์คํธ/path/MemberJoin -> doPost() ํธ์ถ [header์ ์ ๋ณด๊ฐ ๋ด๊ฒจ์ ์๋ฒ์ ์ ์ก] ์ด๋ฆ 1.form ํ๊ทธ action์ผ๋ก ๋ณด๋ผ ์๋ฒ ๋ช ์นญ์ ์ง์ ํ๋ค. 2.form ํ๊ทธ์์ method๋ฅผ ๊ธฐ์ ํด ์์ฒญ์ฒ๋ฆฌ ๋ฐฉ์์ ์ ํ๋ค. ์ฐ๋ น๋ 10๋~20๋ 20๋~30๋ 30๋~40๋ 40๋~50๋ ์ฑ๋ณ ๋จ์ ์ฌ์ ์ทจ๋ฏธ ํ์ด ๋กค ์นดํํฌ์ด ํ์ธ package way; impo.. 2021. 3. 15. Web - Servlet ์ค์ต 3 (์ํ์ฝ๋ , html ์ฝ๋๋ฅผ ๋ฐ์ ์๋ฒ์์ ํ์ธํ ์ถ๋ ฅ) index.html ์ํ์ฝ๋ ํ์ธ ์ํ์ฝ๋ SC_OK SC_NOT_FOUND SC_INTERNAL_SERVER_ERROR HelloServlet package hello; import java.io.IOException; import java.io.PrintWriter; 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 void do.. 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. ์ด์ 1 2 3 4 5 6 7 ยทยทยท 19 ๋ค์