Create a Form Page Through JSP Without Beans

Here we are going to create a Form page through JSP without using Beans. In this application we create a home page form which is filled in by the user and then the information is sent to the next page. For this application we follow the following steps.

Step 1: Create a web application

First we choose a new web application and then click on the next button.

create a web application.jpg

Step 2: Name and Location

After choosing the web application we provide it a specific name and location for it, then click on the next button.

name and location.jpg

Step 3: Server and Setting

In this step we provide it a specific server and choose Java EE 6 Web application and click next


Step 4: Select Framework

There is no need to choose any frame for this application.


Step 5: Create New JSP Files

Create two JSP files: form.jsp and display.jsp.

create a new jsp file.jpg


 <head><title>Create Person</title></head>
  <body bgcolor="cyan">
   <h1>Enter your details</h1>
    <form action="display.jsp" method="post">
       <tr><td>First name:</td>
         <td><input type="text" name="firstName" /></td>
        <tr><td>Last name:</td>
         <td><input type="text" name="lastName" /></td>
         <td><input type="text" name="email" /></td>
        <tr><td>Place of Birth:</td>
        <td><input type="text" name="Placeofbirth" /></td>
        <tr><td>Contact No:</td>
        <td><input type="text" name="cono" /></td>
        <td><input type="text" name="age" /></td>
      <input type="submit" value="Submit details" />


<%@ taglib prefix="c" uri="" %>

  <head><title>Display details</title></head>
    <body bgcolor="green">
     <h1>Your details (or, the details you entered!)</h1>
       <tr><td>First name:</td><td><c:out value="${param.firstName}"/></td></tr>
       <tr><td>Last name:</td> <td><c:out value="${param.lastName}" /></td></tr>
       <tr><td>Email-id:</td> <td><c:out value="${}" /></td></tr>
       <tr><td>Place of birth:</td> <td><c:out value="${param.Placeofbirth}" /></td></tr>
       <tr><td>Contact no:</td> <td><c:out value="${param.cono}" /></td></tr>
       <tr><td>Age:</td> <td><c:out value="${param.age}" /></td></tr>

Compiling and Running the application

After compiling and running the application we will get the following output






Similar Articles