In servlets, Why do we need both GET and POST method
implementations?

Answer Posted / 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
servive()

Is This Answer Correct ?    8 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the methods of request dispatcher in servlet?

718


Which java application server is the best?

754


Write a servlet to upload file on server.

802


Hello, My project requirement is like I need to create a web page using MVC pattern. I hava a bean class, jsp page, servlet, service and dao. My jsp has two fields. One is dropdown list. The option values has to get populated from the database table. The other one is a text box and its value has to come from database table. As of now I have defined the fields in bean class, got the values from database using arraylists in dao class and I called this from service class. Can anyone please tell me the workflow of how the servlet will get this arraylist and populate the arraylist values as dropdown options in jsp page? Also I would like to know the role of bean class in MVC pattern? Thanks in advance!

1995


How can you use a servlet to generate a plain text instead of html?

844


How many objects of a servlet is created?

994


What is the functionality of actionservlet and requestprocessor?

787


Explain the difference between servletconfig and servletcontext in servlet?

763


What if we pass negative value in load-on-startup?

1023


What methodology can be followed to store more number of objects in a remote server?

2003


How do we go with database connection and log4j integration in servlet?

897


What are the phases of a servlet life cycle?

832


What’s the difference between genericservlet and httpservlet?

729


How do you design microservices?

815


What is the disadvantage of cookies?

765