In servlets, Why do we need both GET and POST method
Answers were Sorted based on User's Feedback
Answer / upender
I agree the above two answers. Here is my view.
HTTP Get method perform the following scenarios.
1) By default form submission without specifying method
2)if you click on hyperlinkS or images
3) or if you type url in address bar in brower
and Get there is no side effect. simple it get the resource
form serverside. Some time we require to deal with headers
Get can send only character data and limited data.and also
It can't support binary data.
POST method can support binary data and bulk data.
|Is This Answer Correct ?||8 Yes||2 No|
Answer / abhijitbaji
if you are using HttpServlet then you have to implement
doGet() and or doPost() as per the method specified in jsp.
by default method type is "GET"
if you are using GenericServlet, you have to implement
|Is This Answer Correct ?||8 Yes||4 No|
Answer / amit pandey
In servlet, the default method is doget(), which has
various limitations like the request length shuld be < than
1024 characters, all the information r send as URL, which
is not secure, large data like images cannot be send in URL.
Hence the POST method is implementated that overcome all
this issues w.r.t. the GET method.
Hence, in order that application shuld be more secure &
user orientated, both the methods are impelmentated.
|Is This Answer Correct ?||5 Yes||4 No|
What is forward() and include() of servlets RequestDispatcher interface?
Can servlet have a constructor ?
Write all the phases defined in servlet life cycle?
How many ways are available to ger RequestDispatcher object?
Why do we need servlet filter?
What is filter? Can filter be used as request or response?
Some examples where generic servlet is used?
What do you mean by deployment descriptor?
What is the difference between the http servlet and generic servlet?
What is the procedure of invoking different servlet in a different application?
Why is init() method is used in servlets?
What is the difference between Server and Container?