What is the difference between doGet and doPost?
Answer Posted / shivani
doGet is used when there is are requirement of sending data appended to a query string in the URL. The doGet models the GET method of Http and it is used to retrieve the info on the client from some server as a request to it. The doGet cannot be used to send too much info appended as a query stream. GET puts the form values into the URL string. GET is limited to about 256 characters (usually a browser limitation) and creates really ugly URLs.
doPost allows you to have extremely dense forms and pass that to the server without clutter or limitation in size. e.g. you obviously can't send a file from the client to the server via doGet. doPost has no limit on the amount of data you can send and because the data does not show up on the URL you can send passwords. But this does not mean that POST is truly secure. It is more secure in comparison to doGet method.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Why doesn’t a servlet include main()? How does it work?
What is a servlet engine?
What is difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?
Define the lifecycle for executing a jsp page.
How can we create deadlock situation in servlet?
what is servlet chaining?
hi actully i hav form columns with origin and destination names .as like as i need to create one more column with name amount. my requirement is when i select origin and destination columns automatically i need to get amount from database.how can i. please tel me with relative code
What are the steps that are involved in using the httpservlet class?
What are the different session tracking techniques?
What are the types of protocols supported by httpservlet ?
What is the difference between jsp and servlet life cycle?
What is the requirement of servlet config and servlet context implemented and how are they implemented?
How to get the server information in a servlet?
What do you mean by url pattern in servlet?
How to commuincate between an applet and a servlet?