Feedback Form Servlet Example

Feedback Form Servlet Example

All the time we are accustomed to read client data with getParameter() method, most probably from HTML text fields. But, HTML FORM tag includes many GUI components like radio buttons, SELECT drop down lists, text areas etc. This Client HTML comes with rarely used FORM fields. To do with, a Student Feedback Form is designed where a Student completes his course from an institute and gives feedback of Faculty and Institute amenities.

Servlet Example

To read all the FORM fields, getParameterNames() of HttpServletRequest is used. The feedback data is read by Servlet and sent back to client in a table format.

java.util.Enumeration e = req.getParameterNames();

The getParameterNames() method of javax.serlet.ServletRequest inherited by javax.servlet.http.HttpServletRequest returns an object of Enumeration. This step is explained earlier in Get all parameters of HTML form.

HTML file when all fields are entered.


Servlet Example
Output screen of Servlet Example: Client data put in a table


Servlet Example
Output screen of Servlet Example with data tabulated

Leave a Reply

Your email address will not be published. Required fields are marked *