- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 form data using JSP via GET Method?
Following is an example that passes two values using the HTML FORM and the submit button. We are going to use the same JSP main.jsp to handle this input.
<html> <body> <form action = "main.jsp" method = "GET"> First Name: <input type = "text" name = "first_name"> <br /> Last Name: <input type = "text" name = "last_name" /> <input type = "submit" value = "Submit" /> </form> </body> </html>
Keep this HTML in a file Hello.htm and put it in <Tomcat-installation-directory>/webapps/ROOT directory. When you would access http://localhost:8080/Hello.htm, you will receive the following output.
Try to enter the First Name and the Last Name and then click the submit button to see the result on your local machine where tomcat is running. Based on the input provided, it will generate a similar result as mentioned in the above example.
- Related Articles
- How to read form data using JSP via POST Method?
- How to read form data using JSP?
- How to read all form parameters in JSP?
- How to read a HTTP header using JSP?
- How to read request parameters passed in URL using JSP?
- How to read cookies with JSP?
- How to pass check boxes data using JSP?
- How to read data from *.CSV file using JavaScript?
- How to read data from a file using FileInputStream?
- How to read data from JSON array using JavaScript?
- Uploading data to SAP via WebService using WCF in C#
- How to read/retrieve data from Database to JSON using JDBC?
- How to delete Session data in JSP?
- How to read data in from a file to String using java?
- How to get the final rows of a time series data using pandas series.last() method?

Advertisements