joinForm.jsp
<%@ page language="java" contentType="text/html; charset=EUC-KR"%>
<html>
<head>
<title>Sign up</title>
</head>
<body>
<!-- <h2><th><center>Sign Up</center></th></h2>-->
<center>
<form action="joinChk.jsp" method="post">
<table border=0>
<caption>
<b>Sign Up</b>
</caption>
<tr>
<td align=right bgcolor="green"><font size=2 color="white">ID
: </font></td>
<td bgcolor="green"><input type="text" name="id"></td>
</tr>
<tr>
<td align=right bgcolor="blue"><font size=2 color="white">Password
: </font></td>
<td bgcolor="blue"><input type="password" name="pass"></td>
</tr>
<tr>
<td align=right bgcolor="red"><font size=2>Name : </font></td>
<td bgcolor="red"><input type="text" name="name"></td>
</tr>
<tr>
<td align=right bgcolor="purple"><font size=2 color="white">Sex
: </font></td>
<td bgcolor="purple"><input type="radio" name="sex"
value="Male" checked><font size=2 color="white">Male</font>
<input type="radio" name="sex" value="Female"><font size=2
color="white">Female</font> <input type="radio" name="sex"
value="Prefer not to say"><font size=2 color="white">Prefer
not to say</font></td>
</tr>
<tr>
<td align=right bgcolor="yellow"><font size=2>Age : </font></td>
<td bgcolor="yellow"><input type="text" name="age"></td>
</tr>
<tr>
<td align=right bgcolor="orange"><font size=2>Email : </font></td>
<td bgcolor="orange"><input type="text" name="email"></td>
</tr>
<tr>
<td align=center bgcolor="gray" colspan=2><input type="submit"
value="Join"> <input type="reset" value="Reset"></td>
</tr>
</table>
</form>
</center>
</body>
</html>
JoinBean.java
This file has to be in a package named "join" in the src folder.
package join;
public class JoinBean {
private String id;
private String pass;
private String name;
private String sex;
private int age;
private String email;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getPass() {
return pass;
}
public void setPass(String pass) {
this.pass = pass;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
joinChk.jsp
<%@ page language="java" contentType="text/html; charset=EUC-KR"%>
<%request.setCharacterEncoding("euc-kr");%>
<jsp:useBean id="join" class="join.JoinBean"/>
<jsp:setProperty name="join" property="*"/>
<html>
<head>
<title>Please Double-Check your information.</title>
</head>
<body>
<center>
<table border=1>
<tr>
<td bgcolor="yellow"><font size=2>ID : </td>
<td bgcolor="yellow"><jsp:getProperty name="join" property="id"/></td>
</tr>
<tr>
<td bgcolor="yellow"><font size=2>Password : </td>
<td bgcolor="yellow"><jsp:getProperty name="join" property="pass"/></td>
</tr>
<tr>
<td bgcolor="yellow"><font size=2>Name : </td>
<td bgcolor="yellow"><jsp:getProperty name="join" property="name"/></td>
</tr>
<tr>
<td bgcolor="yellow"><font size=2>Sex : </td>
<td bgcolor="yellow"><jsp:getProperty name="join" property="sex"/></td>
</tr>
<tr>
<td bgcolor="yellow"><font size=2>Age : </td>
<td bgcolor="yellow"><jsp:getProperty name="join" property="age"/></td>
</tr>
<tr>
<td bgcolor="yellow"><font size=2>Email : </td>
<td bgcolor="yellow"><jsp:getProperty name="join" property="email"/></td>
</tr>
</table>
</center>
</body>
</html>
'Codes & Projects' 카테고리의 다른 글
JSP / CSS) Log In - JavaBean, Action tags (0) | 2022.09.02 |
---|---|
JSP/ Oracle) Members list (0) | 2022.08.31 |
JSP) Forward /Include action tags - Web page templates (0) | 2022.08.30 |
JSP) Log in / Shopping cart (0) | 2022.08.29 |
HTML / Javascript / JSP ) Sign up Form2 (0) | 2022.08.28 |