Pr.Pg Next Pg

JSP Form Processing using POST method tutorials

 

JSP program for form processing using Post method

Sam Sir

<%-- PostFormProcess --%>

<%-- JSP program for form processing using Post method --%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Post Data</title>

</head>

<body>

<center><h3>Form Data Using POST Method</h3></center>

<table>

<tr>

<td> <b>First Name:</b> </td>

<td><%= request.getParameter("First_Name")%> </td>

</tr>

<tr>

<td> <b>Last Name:</b></td>

<td> <%= request.getParameter("Last_Name")%> </td>

</tr>

<tr>

<td><b>Email:</b></td>

<td><%=request.getParameter("Email")%> </td>

</tr>

<tr>

<td><b>Password:</b> </td>

<td><%=request.getParameter("Password")%></td>

</tr>

<tr>

<td> <b>Sex:</b></td>

<td> <%=request.getParameter("Sex")%></td>

</tr>

</table>

</body>

</html>

 

 

 


 

HTML form for user input which will be processed by PostFormProcess.jsp

Sam Sir

<!—PostForm.html -->

<!-- HTML form for user input -->

<html>

<head>

<title>Post Data</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

</head>

<body>

<center><h3>User Input Form</h3></center>

<FORM action="PostFormProcess.jsp" method="post">

<table>

<tr>

<td>First name: </td>

<td><INPUT type="text" name="First_Name"> </td>

</tr>

<tr>

<td>Last name: </td>

<td><INPUT type="text" name="Last_Name"></td>

</tr>

<tr>

<td>Email:</td>

<td><INPUT type="text" name="Email"> </td>

</tr>

<tr>

<td>Password: </td>

<td><INPUT type="password" name="Password"> </td>

</tr>

<tr>

<td><INPUT type="radio" name="Sex" value="Male"> Male </td>

</tr>

<tr>

<td><INPUT type="radio" name="Sex" value="Female"> Female</td>

</tr>

<tr>

<td><INPUT type="submit" value="Send"></td>

<td><INPUT type="reset"></td>

</tr>

</table>

</FORM>

</body>

</html>

Output

POST Method

 

POST Method

Pr.Pg border                                              Next Pg