Home Jsp How to handle a form in JSP



How to handle a form in JSP
Posted on: February 7, 2008 at 12:00 AM
This section teaches you about the creating a from and the procedure of handling the form through the JSP code.

How to handle a form in JSP

     

This section teaches you about the creating a from and the procedure of handling the form through the JSP code. This section provides JSP code which used the HTML code for creating a form and this form is handled by the JSP code.

All the HTML code are the client side code i.e. executed on your browser while all the JSP code is the server side code which executes on the server.

 

Here is the code of the program: 

 

<html>
	<head><title>Handling Form in JSP.</title></head>
	<body>
		<form method="post">
			<table border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td>Enter your name: </td>
					<td><input type="text" name="txtName"
 size="20"/></td>
				</tr>
				<tr>
					<td>&nbsp;</td>
					<td><input type="submit" name="B1" 
value="Submit"/><input type="reset" name="B2" value="Reset"/></td>
				</tr>
			</table>
		</form>
		<%
			if(request.getParameter("txtName") != null){
				out.println(request.getParameter("txtName"));
			}
		%>
	</body>
</html>

Output of the program:

Download this example.

Related Tags for How to handle a form in JSP:
htmlcjspidebrowserserverormformioclientsedviexecclithisidexerowjshandleforrowsieexecutewhilewsewseildessectionliusebrowseinmlrmmntsidsidejclesallprocreatingcutwhichsxespathtmishalleaandarcodcodervssthatiprndodeono


More Tutorials from this section

Ask Questions?    Discuss: How to handle a form in JSP   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.