๐ก form์ ์๋๋ฐฉ์
1) form์ ๋ฐ์ดํฐ๋ฅผ ์ฑ์ ์๋ฒ๋ก ๋ณด๋ธ๋ค
2) ์๋ฒ๋ form์ ๋ฐ์ JSP์๊ฐ์ ์๋ฒ์คํฌ๋ฆฝํธ๋ก ๋ณด๋ธ๋ค
3) JSP๋ ์ ๋ ฅ ๋ฐ์ดํฐ๋ฅผ ์ฒ๋ฆฌํด ์๋ก์ด ์นํ์ด์ง๋ฅผ ์์ฑํ๋ค
4) ์ ๋ ฅ์ ๋ํ ์๋ก์ด ์นํ์ด์ง๊ฐ ์๋ต๋๋ค
<form action="input.jsp" method="post"> </form>
<form action="input.jsp" method="get"> </form>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="test.jsp" method="get">
ID : <input name="id"> <br/>
PW : <input type = "password" name = "pw">
<input type = "submit">
</form>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
String v_id = request.getParameter("id");
String v_pw = request.getParameter("pw");
%>
์์ด๋๋ <%=v_id %> <br/>
๋น๋ฐ๋ฒํธ๋ <%=v_pw %>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="test.jsp" method="post">
ID : <input name="id"> <br/>
PW : <input type = "password" name = "pw">
<input type = "submit">
</form>
</body>
</html>