Register.html

<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style/style.css">
</head>
<body>
	<div id="wrap">
		<form action="ResgisterProc.jsp">
			<table>
				<tbody>
					<tr>
						<td><b>회원가입</b></td>
					</tr>
				
					<tr>
						<td>
							아이디
						</td>
						<td>
							<input type="text" name="mem_id" size="15" autofocus="autofocus">
						</td>
						<td>
							아이디를 적어주세요
						</td>
					</tr>
					
					<tr>
						<td>
							패스워드
						</td>
						<td>
							<input type="password" name="mem_pwd" size="15">
						</td>
						<td>
							패스워드를 적어주세요
						</td>
					</tr>
					
					<tr>
						<td>
							패스워드 확인
						</td>
						<td>
							<input type="password" name="mem_respwd" size="15">
						</td>
						<td>
							패스워드를 확인합니다.
						</td>
					</tr>
					
					<tr>
						<td>
							이름
						</td>
						<td>
							<input type="text" type="text" name="mem_name" size="15">
						</td>
						<td>
							실명을 적어주세요.
						</td>
					</tr>
					
					<tr>
						<td>
							이메일
						</td>
						<td>
							<input type="text" name="mem_email" size="27">
						</td>
						<td>
							이메일을 적어주세요
						</td>
					</tr>
					
					<tr>
						<td>
							전화번호
						</td>
						<td>
							<input type="text" name="mem_phone" size="20">
						</td>
						<td>
							연락처를 적어주세요
						</td>
						
						<tr>
							<td>
								<button>보내기</button>
								&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
								<button type="reset">다시쓰기</button>
							</td>
						</tr>
				</table>
			</tbody>
		</table>
	</form>
	</div>
	<!-- div#wrap -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="script/script.js"></script>
</body>
</html>



RegisterBean.java

package pack_res;

public class RegisterBean {
	
	private String mem_id;
	private String mem_pwd;
	private String mem_name;
	private String mem_email;
	private String mem_phone;
	
	
	public String getMem_id() {
		return mem_id;
	}
	public void setMem_id(String mem_id) {
		this.mem_id = mem_id;
	}
	public String getMem_pwd() {
		return mem_pwd;
	}
	public void setMem_pwd(String mem_pwd) {
		this.mem_pwd = mem_pwd;
	}
	public String getMem_name() {
		return mem_name;
	}
	public void setMem_name(String mem_name) {
		this.mem_name = mem_name;
	}
	public String getMem_email() {
		return mem_email;
	}
	public void setMem_email(String mem_email) {
		this.mem_email = mem_email;
	}
	public String getMem_phone() {
		return mem_phone;
	}
	public void setMem_phone(String mem_phone) {
		this.mem_phone = mem_phone;
	}
	
	
}



Register.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<jsp:useBean id="regForm" class="pack_res.RegisterBean" scope="page"/>
<jsp:setProperty property="*" name="regForm"/>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style/style.css">
</head>
<body>
	<div id="wrap">
		<p>
			<jsp:getProperty property="mem_name" name="regForm"/>
			회원님이 작성하신 내용입니다.
		</p>
		<table>
			<tr>
				<td>아이디</td>
				<td><jsp:getProperty property="mem_id" name="regForm"/></td>
			</tr>
			
			<tr>
				<td>패스워드</td>
				<td><jsp:getProperty property="mem_pwd" name="regForm"/></td>
			</tr>
			<tr>
				<td>이름</td>
				<td><jsp:getProperty property="mem_name" name="regForm"/></td>
			</tr>
			<tr>
				<td>이메일</td>
				<td><jsp:getProperty property="mem_email" name="regForm"/></td>
			</tr>
			<tr>
				<td>전화번호</td>
				<td><jsp:getProperty property="mem_phone" name="regForm"/></td>
			</tr>
		</table>
		
	</div>
	<!-- div#wrap -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="script/script.js"></script>
</body>
</html>


결과


Leave a comment