Explaination ¶
JSP (Request, Response)
클트(form) ->
html 한 텍트
2
1. Get : data 표
2. post :
// form method="get" or "post" . action="receive.jsp" //
3. html 활 하 파.html 한.
html 한 텍트
1. Get : data 표
2. post :
// form method="get" or "post" . action="receive.jsp" //
3. html 활 하 파.html 한.
Source Code ¶
html File ¶
~cpp <html> <head> </head> <body> <form name="sub" method="post" action="receive.jsp"> ID : <input type="text" name="id"> <br> PW : <input type="password" name="pass"> <input type="submit" value=""> <select name="name"> <option value="1"> Heo </option> <option value="2"> Jun </option> <option value="3"> Su </option> </select><br> <input type="checkbox" name="hobby" value="sport">sport <input type="checkbox" name="hobby" value="music">music <input type="checkbox" name="hobby" value="movie">movie <input type="checkbox" name="hobby" value="drama">drama <br><br> <input type="radio" name="season" value="spring" checked>spring<br> <input type="radio" name="season" value="summer">summer<br> </form> </body> </html>
receive.jsp File ¶
~cpp <html> <head> </head> <body> <% String id = request.getParameter("id"); String pass = request.getParameter("pass"); String list = request.getParameter("name"); String hobby[] = request.getParameterValues("hobby"); String hobby_list = " "; String season = request.getParameter("season"); for(int i=0; i < hobby.length; i++) { hobby_list = hobby_list + hobby[i] + " "; } if(list.equals("1")){ %> Heo <br> <% } else { %> Jun <br> <% } %> <%=id%><br> <%=pass%><br> <%=list%> 하 <%=hobby_list%> <br> 하 <%=season%> </body> </html>