If we put some request, intially either doget() or dopost() is getting invoked? why not any servlet life cycle method is not getting invoked?Then why don't we include this doget() and dopost() in the servlet life cycle methods?
If I understand your question, doPost/doGet is part of servlet's life-cycle only but is implied. Meaning, service() method plays the actual role of calling respective request methods (doGet/doPost) upon inspecting HTTP header. To brief, init/service/destroy are the life-cycle methods and doGet/doPost/doDelete are the methods called by service. HTH.
ramana
Aug 31st, 2006
If u send any request to the servlet then container calls generic servlet service() method first.Ttis is implemented method in HttpServlet.The default implemented code in this method is calling of HttpServlet Service().In this default implementaton code is checking code.Means it checks the incoming request contains get methos then calls doGet().If it contains post then it calls doPost().If incoming request doesnot contain any method by default it calls doGet().
First Generic Servlet service method invokes the req, res objects and after that it converts req, res into httpservletreq, httpservletres objects then it invokes doGet(), or doPost() methods
Vasuneet Arya
Sep 20th, 2006
Dear,
doGet and doPost are not the part of Servlet Life Cycle directly. But indirectly if devloper have not been override service method of Servlet ,they are parting in servlet life cycle because these method would be called by Service method of HtttpServlet.
Life cycle of Servlet
Init()/Service()/destroy()
and service mehtod calls doPost or doGet method according to Http Header information.
Neha
Nov 18th, 2007
If we put some request initially....the server call's the HttpServlet's service method where by seeing the request type service method call either doGet( if request is get) or doPost (if request is Post).... so all is done by service method and its included in servlet's life cycle.
If I understand your question, doPost/doGet is part of servlet's life-cycle only but is implied. Meaning, service() method plays the actual role of calling respective request methods (doGet/doPost) upon inspecting HTTP header. To brief, init/service/destroy are the life-cycle methods and doGet/doPost/doDelete are the methods called by service.
If I understand your question, doPost/doGet is part of servlet's life-cycle only but is implied. Meaning, service() method plays the actual role of calling respective request methods (doGet/doPost) upon inspecting HTTP header. To brief, init/service/destroy are the life-cycle methods and doGet/doPost/doDelete are the methods called by service. HTH.
If we put some request, intially either doget() or dopost() is getting invoked? why not any servlet life cycle method is not getting invoked?Then why don't we include this doget() and dopost() in the servlet life cycle methods?
Profile Answers by Roshini Questions by Roshini
Questions by Roshini