What is the difference between Difference between doGet() and doPost()?
Answer / Roop Kishor
doGet() and doPost() are methods in Servlets used to handle HTTP requests. The main differences are:n
1. Request Data:n- doGet() gets request data from the URL query string.n- doPost() gets request data from the body of the HTTP request, which may be more secure as it's not visible in the URL.n
2. Encoding:n- GET requests are typically stateless and safe, so they should use ASCII characters only. If needed, special characters can be URL encoded.n- POST requests can handle more data and non-ASCII characters without being encoded.
3. Default Behavior:n- A new doGet() request is processed even if it's the same as a previous one (idempotent).n- A new doPost() request results in a new servlet instance (not idempotent).
| Is This Answer Correct ? | 0 Yes | 0 No |
When Servlet is unloaded?
what is EJB and Java servlet
What are the kinds of http requests?
can we override service method in my servlet class..?? if yes or no why ??
Elucidate servlet attributes and its scope?
What do you understand by mime type?
What is pure servlet?
how the server will know its the same jsp page?
What is meant by a web application
what is servlet chaining?
How to read request headers from servlets?
Why session tracking is needed?