Pr.Pg Next Pg

Reading Form Data using JSP tutorials

  • Depending on situation JSP uses below different method for parsing form data.


  • Use for reading the binary data coming from client.


  • Returns the value of a request parameter as a String, or null if the parameter does not exist. request parameters are extra information sent with the request.


  • Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.


  • Returns an Enumeration of String objects containing the names of the parameters contained in this request. If the request has no parameters, the method returns an empty Enumeration.


JSP Program for Form Processing using URL

Sam Sir

<%-- URLdata.jsp --%>

<%-- JSP Program for Form Processing using URL --%>

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



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

<title>URL Data</title>



<center><h3>Form Get Data using URL</h3></center>



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

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



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

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



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

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







Note: Pass the following URL:

  • http://localhost:8080/JSP/URLdata.jsp?First_Name=Rahul&Last_Name=Dev&Sex=Male in the browser after URLdata.jsp compilation.

Pr.Pg border                                              Next Pg