getParameter() - Passing data from client to JSP Last Updated : 10 Jun, 2018 Comments Improve Suggest changes Like Article Like Report The familiarity of the getParameter() method in getting data, especially form data, from a client HTML page to a JSP page is dealt with here. The request.getParameter() is being used here to retrieve form data from client side. Steps to be followed 1) First, a html page exGetParameter.html accepts data from the client. The client enters text in the space provided and clicks on 'Submit'. 2) Immediately the getparam.jsp page gets called, it being mentioned in the action tag. 3) This JSP page fetches the data using getParameter() method and displays the same to the user. Note: Entire application has been developed and tested on NetBeans IDE 8.1. Page to accept client data : exGetParameter.html page html <html> <head> <title>Get Parameter Example</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <!-- Here we specify that the from data will be sent to getparam.jsp page using the action attribute --> <form name="testForm" action="getparam.jsp"> <label><h1>Enter a text and click Submit<h1/></label><br/> <input type="text" name="testParam"><br/> <input type="submit"> </form> </body> </html> Page to fetch client data : getparam.jsp html <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <%-- Here we fetch the data using the name attribute of the text from the previous page --%> <% String val = request.getParameter("testParam"); %> </body> <%-- Here we use the JSP expression tag to display value stored in a variable --%> <h2>The text entered was : </h2><%=val%> </html> Outputs Client Data : exGetParameter.html After clicking on 'Submit' the following screen appears. Fetched Data from Client : getparam.jsp Comment More infoAdvertise with us Next Article getParameter() - Passing data from client to JSP S SaagnikAdhikary Follow Improve Article Tags : Java Java Programs Java-JSP Practice Tags : Java Similar Reads Program to validate a user using JSP Introduction to JSP : JSP(Java Server Page) is a server-side technology, used for developing webpages that support dynamic content. It enables the separation of dynamic and static content, thereby reducing development complexity. Developers are thus, armed with the power to insert java code in HTML 4 min read Java Program to Get Connected to a Web Server In today's interconnected world, connecting to web servers is a fundamental skill for software developers. Whether you're building a web application that needs to fetch data from external sources, testing a web service, or even performing web scraping for research, knowing how to interact with web s 4 min read How to use HttpURLConnection for sending HTTP POST requests in Java? HttpURLConnection is a Java class that allows us to send HTTP requests and receive responses from servers. It is a powerful tool for communicating with common web servers used in Java development, including Android. Here is an overview of its main features. HTTP requests can be sent using several me 4 min read getAttribute() - Passing data from Server to JSP Suppose some data at the Server side has been created and now in order to pass that information in a JSP page, there is a need of request.getAttribute() method. This, in fact differentiates the getAttribute() and getParameter() methods. The latter is used to pass Client side data to a JSP. Implement 3 min read How to Capture Data using @RequestParam Annotation in Spring? The @RequestParam annotation enables Spring to capture input data that may be passed as a query, form data, or any arbitrary custom data. It is used to bind a web request parameter to a method parameter. Here, we are going to understand these two above lines, and we will see how we can capture data 6 min read Like