 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to read request parameters passed in URL using JSP?
The following URL will pass two values to HelloForm program using the GET method.
href="http://localhost:8080/main.jsp?first_name=ZARA&last_name=ALI"
Below is the main.jsp JSP program to handle input given by web browser. We are going to use the getParameter() method which makes it very easy to access the passed information −
<html>    <head>       <title>Using GET Method to Read Form Data</title>    </head>    <body>       <h1>Using GET Method to Read Form Data</h1>       <ul>          <li><p><b>First Name:</b>             <%= request.getParameter("first_name")%>             </p></li>          <li><p><b>Last Name:</b>             <%= request.getParameter("last_name")%>             </p></li>       </ul>    </body> </html> Now type href="http://localhost:8080/main.jsp?first_name=ZARA&last_name=ALI" in your browser's Location:box. This will generate the following result −
| Using GET Method to Read Form Data
 | 
Advertisements
 