728x90
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>signupPro</title>
</head>
<body>
<%
request.setCharacterEncoding("UTF-8");
String id = request.getParameter("id");
String pw = request.getParameter("pw");
String name = request.getParameter("name");
String email = request.getParameter("email");
String gender = request.getParameter("gender");
String[] hobb = request.getParameterValues("hobbies");
String job = request.getParameter("job");
String bio = request.getParameter("bio");
System.out.println(id);
System.out.println(pw);
System.out.println(name);
System.out.println(email);
System.out.println(gender);
System.out.print(hobb);
if(hobb != null){
for(String s : hobb){
System.out.println(s);
}
}
System.out.println(job);
System.out.println(bio);
%>
<h3> sinupPro page</h3>
<table>
<tr>
<td>ID *</td>
<td><%= id %></td>
</tr>
<tr>
<td>PW *</td>
<td><%= pw %></td>
</tr>
<tr>
<td>Name *</td>
<td><%= name %></td>
</tr>
<tr>
<td>Email</td>
<td><%= email %></td>
</tr>
<tr>
<td>Gender</td>
<td><input type="radio" name="gender" value="male" checked/> 남</td>
<td><input type="radio" name="gender" value="female" /> 여</td>
</tr>
<tr>
<td>Hobbies</td>
<td>
<% if(hobb != null){
for(int i = 0; i < hobb.length; i++){ %>
<%= hobb[i] %>
<% }
}
%>
</td>
</tr>
<tr>
<td>Job</td>
<td>
<%= job %>
</td>
</tr>
<tr>
<td>Bio</td>
<td>
<textarea row="5" cols="22" name="bio"> <%= bio %></textarea>
</td>
</tr>
</table>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>회원가입</title>
</head>
<body>
<form action="signupPro.jsp" method="post">
<table>
<tr>
<td>ID *</td>
<td><input type="text" name="id" /></td>
</tr>
<tr>
<td>Password *</td>
<td><input type="password" name="pw" /></td>
</tr>
<tr>
<td>Name *</td>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="email" /></td>
</tr>
<tr>
<td>Gender</td>
<td>
<input type="radio" name="gender" value="male" checked /> 남
<input type="radio" name="gender" value="female" /> 여
</td>
</tr>
<tr>
<td>Hobbies</td>
<td>
<input type="checkbox" name="hobbies" value="music" /> Music
<input type="checkbox" name="hobbies" value="sports" /> Sports
<input type="checkbox" name="hobbies" value="travel" /> Travel
<input type="checkbox" name="hobbies" value="movies" /> Movies
</td>
</tr>
<tr>
<td>Job</td>
<td>
<select name="job">
<option value="employer">Employer</option>
<option value="employee">Employee</option>
<option value="teacher">Teacher</option>
<option value="student">Student</option>
<option value="freelancer">Freelancer</option>
<option value="etc">Etc</option>
</select>
</td>
</tr>
<tr>
<td>Bio</td>
<td>
<textarea rows="5" cols="22" name="bio"></textarea>
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="가입" />
<input type="reset" value="재작성" />
</td>
</tr>
</table>
</form>
</body>
</html>
728x90
'WEB Creator > [JSP]' 카테고리의 다른 글
[JSP] 3. 에러 페이지 세팅 (0) | 2022.06.13 |
---|---|
[JSP] 2 - 내장 객체(Implicit Object) (2) response, out, application (0) | 2022.06.13 |
[JSP] 2 - 내장 객체(Implicit Object) (1) Request (0) | 2022.06.13 |
[JSP] 1 - JSP 페이지 구성 요소(Directive, Script) (0) | 2022.06.10 |
[JSP] 설정 (0) | 2022.06.10 |