I have one servlet class file which contains the service() ,doGet() and doPost() methods . I have posted the Person details from JSP file for updation . I don't know which service method will be first invoke
can you tell me ?
Assuming is an HttpServlet, it will call service() then doPost() (assuming your FORM action = "POST").
According to the docs, service() "receives standard HTTP requests from the public service method and dispatches them to the doXXX methods defined in this class... There's no need to override this method. "
JSPs are compiled into classes that extend HttpServlet, and being servlets it's the service method that is called. Unless you've overridden that method, it will call one of the doXXX methods, depending on the HTTP method of the request. If you've overridden the service method then it will only do what you've written inside it.