What is the diff b/w doGet() and service() method

Showing Answers 1 - 12 of 12 Answers

Jyotsna

  • Aug 10th, 2006
 

service( ) method in the HttpServlet class calls the doGet( ) method which processes http requests.

  Was this answer useful?  Yes

veerendra Jote

  • Aug 16th, 2006
 

Well the service method tries to determine which of the doXXX method needs to be called.Appropriately either doGet, doPost, doDelete, doPut etc etc are called,

  Was this answer useful?  Yes

guest

  • Oct 10th, 2006
 

Hi, service is a part of the life cycle for servlet. when a request came in for a servlet, then the container will load the servlet into memory[If the servlet was requested for first time]  and initialize the servlet through init method. which is the first phase of the servlet life cycel. the next phae was service. In this phase, for every request the servlet will check for the header request method either get or post. then, corresponding methods either doGet or doPost will be called. I tried to give a bit more explanation, because you cannot differentiate the doGet and service of a servlet. Hope I gave a clear answer. Thank you.

  Was this answer useful?  Yes

Rajkumar

  • Nov 8th, 2006
 

When we make a request to the application webcontainer makes the request and response object and creates the servlet instance.After it calls the servlet life cycles methods like init().After completing the intialization it calls the service()method passing servletrequest and response objects as parameters.service() method is designed in such a way the depending on type of the requset method it calls the either doGet() or doPost() method.There is no need to make a expicit call to doGet() or doPost() method.

  Was this answer useful?  Yes

delindia Fathima

  • Dec 22nd, 2011
 

Service method orginates from Generic Servlet and so service method is used to do something which does not involve http protocol.

service handles standard HTTP requests by dispatching them to the handler methods(doXXX) for each HTTP request type

  Was this answer useful?  Yes

SUJATA WAGHMARE

  • Jan 10th, 2014
 

doget() accept http type of request form protected seveices()...send data to url throw..meas limited data..services method used to genericservlet class and only accept servletrequest nad servletrespons object..no accept http type request....

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions