An illustrative project to show how data is send to the server using GET and POST methods
The application start from index.jsp file. The default welcome file for https://{host_name}/SimpleServlet context path.
- WELCOME PAGE
Two method are given to pass data to the server
- Submit Form using GET method
- Submit Form using POST method
Selecting any option opens a simple form page
a). When GET method is used user is given warning that it's credential is visible in the URL
b). When POST method is used data is passed in the body so the secret is safe!!
GET Method -
- Parameters are passed in the URL therefore it should not be used when dealing with sensitive data
- GET request can be bookmarked
- GET requests remain in the browser history
POST Method -
- Parameter are passed in the request body therefore used when dealing with sensitive data
- POST cannot be bookmarked
- POST request do not remain in the browser history
- POST requests have no restrictions on data length.
Used deployment descriptor file to map FormServlet to SimpleServlet/submittedForm context path.
- web.xml file directory - src/main/webapp/WEB-INF
- jsp pages directory - src/main/webapp
- Java
- Servlet
- JSP
- Maven