What methods will be called in which order?((i.e)service(),doget(),dopost())

Showing Answers 1 - 6 of 6 Answers

chanra_raya

  • Sep 30th, 2005
 

Service()->doGet() OR doPost()

  Was this answer useful?  Yes

parsi venkat

  • Mar 23rd, 2006
 

HTTPServlet which extends the Servlet Interface overides the Service() method and implements as this..

service(HttpRequest req,HttpResponse rep)

{

If(request=="get")

 doGet(req,rep)

else if(request=='post')

doPost(req,rep)

...

}

so you can think as the service method calls some other Named function whose name is as HTMLs Form Submit method.

  Was this answer useful?  Yes

Isis

  • Apr 15th, 2006
 

service()

then doGet()

or doPost() depending on the call

actually service methos calls doXXX methods 

  Was this answer useful?  Yes

Rajkumar

  • Nov 8th, 2006
 

After completion of init() method web container calls the service() method passig servletrequest and response objects as a parameters.service() method is designed in such a way that depending upon the request method it calls the either doGet() or doPost() method.There is no need to make a explicit call to doGet() r doPost() method.....

  Was this answer useful?  Yes

Duryodhan

  • Aug 7th, 2007
 

All above are not defining real scinerio.
When we are extending HttpServlet then 1st of all doGet() or doPost() will be called then internally it will call to protected service() method and it will generate the response.

  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