Saturday, 4 April 2015


(1)write below code example for html form   save it  as hello.html  & save this file under path="C:\xampp\tomcat\webapps\ROOT" :

<form action="main.jsp" method="GET">
First Name: <input type="text" name="first_name">
<br />
Last Name: <input type="text" name="last_name" />
<input type="submit" value="Submit" />

(3)now use get method for collecting  form value  following code is for  main.jsp  :

<title>Using GET and POST Method to Read Form Data</title>
<h1>Using GET Method to Read Form Data</h1>
<li><p><b>First Name:</b>
   <%= request.getParameter("first_name")%>
<li><p><b>Last  Name:</b>
   <%= request.getParameter("last_name")%>

(4)now runt jsp file:


No comments:

Post a Comment