1~10 강의 는 겹치는 부분과 너무 직관적이라 패쓰
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%request.setCharacterEncoding("UTF-8"); %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h2>회원 가입</h2>
<form action ="RequestJoinProc.jsp" method ="post">
<table width ="500" border="1">
<tr height="50">
<td width="150" align="center"> 아이디</td>
<td width="350" align="center"><input type="text" name="id" size="40"></td>
</tr>
<tr height="50">
<td width="150" align="center"> 비밀번호</td>
<td width="350" align="center"><input type="password" name="pass1" size="40"></td>
</tr>
<tr height="50">
<td width="150" align="center"> 비밀번호확인</td>
<td width="350" align="center"><input type="password" name="pass2" size="40"></td>
</tr>
<tr height="50">
<td width="150" align="center"> 이메일</td>
<td width="350" align="center"><input type="text" name="email" size="40"></td>
</tr>
<tr height="50">
<td width="150" align="center"> 전화번호</td>
<td width="350" align="center"><input type="text" name="tel" size="40"></td>
</tr>
<tr height ="50">
<td width="150" align="center"> 당신의 관심분야</td>
<td width="350" align="center">
<input type="checkbox" name="hobby" value="캠핑"/>캠핑
<input type="checkbox" name="hobby" value="등산"/>등산
<input type="checkbox" name="hobby" value="영화"/>영화
<input type="checkbox" name="hobby" value="독서"/>독서
</td>
</tr>
<tr height="50">
<td width="150" align="center"> 당신의 직업은</td>
<td width="350" align="center">
<select name="job">
<option value="교사">교사</option>
<option value="변호사">변호사</option>
<option value="의사">의사</option>
<option value="기술사">기술사</option>
</select>
</td>
</tr>
<tr height="50">
<td width="150" align="center"> 당신의 직업은</td>
<td width="350" align="center">
<input type="radio" name="age" value="10">10대
<input type="radio" name="age" value="20">20대
<input type="radio" name="age" value="30">30대
<input type="radio" name="age" value="40">40대
</td>
</tr>
<tr height="50">
<td width ="150" align="center"> 하고싶은 말</td>
<td width ="150" align="center">
<textarea rows="5" cols="40" name="info"></textarea>
</td>
<tr height="50">
<td align="center" colspan="2">
<input type="submit" value="회원 가입">
<input type="reset" value="취소">
</td>
</tr>
</table>
</form>
</body>
</html>
이메일은 이메일 형식으로 작성가능하다(크롬기능이다)
<body>
<H2> 회원 정보 보기</H2>
<%
request.setCharacterEncoding("utf-8");
String id =request.getParameter("id");
String pass1 =request.getParameter("pass1");
String pass2 =request.getParameter("pass2");
String email1 =request.getParameter("email1");
String tel =request.getParameter("tel");
//[]열 타입으로 리턴
String [] hobby = request.getParameterValues("hobby");
String job = request.getParameter("job");
String age = request.getParameter("age");
String info = request.getParameter("info");
if(!pass1.equals(pass2)){
%>
<script type="text/javascript">
alert("비밀번호가 틀립니다");
history.go(-1);// 전 단계로 이동하세요
</script>
<%} %>
<table width = "500" border="1">
<tr height="50">
<td width="150" align="center">아이디</td>
<td width="350" align="center"><%=id %></td>
</tr>
<tr height="50">
<td width="150" align="center">패스워드</td>
<td width="350" align="center"><%=pass1 %></td>
</tr>
<tr height="50">
<td width="150" align="center">전화번호</td>
<td width="350" align="center"><%=tel %></td>
</tr>
<tr height="50">
<td width="150" align="center">이메일</td>
<td width="350" align="center"><%=email1 %></td>
</tr>
<tr height="50">
<td width="150" align="center">직업은</td>
<td width="350" align="center"><%=job %></td>
</tr>
<tr height="50">
<td width="150" align="center">연령은</td>
<td width="350" align="center"><%=age %></td>
</tr>
<tr height="50">
<td width="150" align="center">하고싶은 말</td>
<td width="350" align="center"><%=info %></td>
</tr>
<tr height="50">
<td width="150" align="center">당신의 관심분야</td>
<td width="350" align="center">
<%
for(String value:request.getParameterValues("hobby")){
out.print(value);
}
%>
</td>
</tr>
</table>