Understanding GET and POST

GET : is used to get resource from the server:

Ex : Just change the method from post to get in the form and hit the URL.

Observation :

URL after submitting form :

http://localhost:8080/SimpleServletProject/xmlservletpath?userName=Mohit&lastName=malhotra&profession=Manager&countries=India&cities=Mumbai

1) All the parameters are sent as query parameters in the GET request.

2) Refresh the browser and the GET operation will have same effect , browser will not warn us.

POST : is user to create resource on the server:

Observation :

On Refreshing we got the confirm Resubmission message from the browser :

HttpServlet is a java specification :

Download Apache tomcat Doc : ( from source code distribution)

Extract it

Attach source : (Option will come when you try to open HttpServlet class )

Check all the methods of HttpServlet provided by Tomcat:

Last updated

Was this helpful?