basic requirements:
Eclipse
Netbeans
File 1 named : "index.jsp"
<%--
Document : index
Created on : Feb 27, 2015, 7:07:19 PM
Author : Msm.Fathih
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Using Forms</title>
</head>
<body>
<h1>Using Forms</h1>
<form name="myForm" action="display.jsp">
<table border="1">
<tbody>
<tr>
<td>First Name : </td>
<td><input type="text" name="first" value="" size="50" /></td>
</tr>
<tr>
<td>Last Name : </td>
<td><input type="text" name="last" value="" size="50" /></td>
</tr>
<tr>
<td>Email Address : </td>
<td><input type="text" name="email" value="" size="50" /></td>
</tr>
<tr>
<td>Gender :</td>
<td><select name="gender">
<option>Male</option>
<option>Female</option>
</select></td>
</tr>
<tr>
<td>Date of Birth : </td>
<td><input type="text" name="dob" value="MM/DD/YYYY" size="15" /></td>
</tr>
</tbody>
</table>
<input type="reset" value="Clear" name="clear" />
<input type="submit" value="Submit" name="submit" />
</form>
</body>
</html>
File 2 named : "Display.jsp"
<%--
Document : display.jsp
Created on : Feb 27, 2015, 7:26:59 PM
Author : Msm.Fathih
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Using Forms</title>
</head>
<body>
<h1>Using Forms</h1>
<%
String firstName = request.getParameter("first");
String lastName = request.getParameter("last");
String emailAddress = request.getParameter("email");
String gender = request.getParameter("gender");
String dob = request.getParameter("dob");
%>
<table border="1">
<tbody>
<tr>
<td>First Name :</td>
<td><%= firstName %></td>
</tr>
<tr>
<td>Last Name :</td>
<td><%= lastName %></td>
</tr>
<tr>
<td>Email Address</td>
<td><%= emailAddress %></td>
</tr>
<tr>
<td>Gender :</td>
<td><%= gender %></td>
</tr>
<tr>
<td>Date of Birth</td>
<td><%= dob %></td>
</tr>
</tbody>
</table>
</body>
</html>
0 Comment to "Embedded Java Server Page(JSP) with HTML"
Post a Comment