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()?
Why is http protocol called as a stateless protocol?
Name the packages that work with servlet?
How does tomcat servlet container work?
How do you configure a centralized error handler in servlets?
A client sends requests to two different web components. Both of the components access the session. Will they end up using the same session object or different session ?
Why do you use session tracking in httpservlet?
What is preinitialization of a servlet?
How would you create deadlock on your servlet?
What is the default http method in the servlet?
What is the dispatcher servlet?
What are sessions in servlets?
I have a requirement Here we have a ResultSet object that will contain 50 records i need to print those recors in to a webpage(i.e; view according to MVC architectures that mybe servlet or jsp) . Here i need to print the records 10 per page that is 1 to 10 in page one and 11 to 20 in page two like remaining will be appeared in other pages we need to display those page numbers whenever we click on that page number we will go to that page and display 10 records like we will display 5 pages it is like this << 1 2 3 4 5 next >>
Is that servlet is pure java object or not?
What is httpservlet class?