The javax.servlet.Servlet interface defines the three methods known as life-cycle method.
public void init(ServletConfig config) throws ServletException
public void service( ServletRequest req, ServletResponse res) throws ServletException, IOException
public void destroy()
First the servlet is constructed, then initialized wih the init() method.
Any request from client are handled initially by the service() method before delegating to the doXxx() methods in the case of HttpServlet.
There are two more methods.....
public abstract String getServletInfo()
public abstract ServletConfig getServletConfig()
because JSP internally changes in servlet and then follow servlet life cycle, so it is slower than servlet
Each servlet has the same life cycle: * A server loads and initializes the servlet * The servlet handles zero or more client requests * The server removes the servlet (some servers do this step only when they shut down) == When a server loads a servlet, the server runs the servlet's init method. Initialization completes before client requests are handled and before the servlet is destroyed. Even though most servlets are run in multi-threaded servers, servlets have no concurrency issues during servlet initialization. The server calls the init method once, when the server loads the servlet, and will not call the init method again unless the server is reloading the servlet. The server can not reload a servlet until after the server has destroyed the servlet by calling the destroy method. == After initialization, the servlet is able to handle client requests. This part of the servlet life cycle was handled in the previous lesson. == Servlets run until the server are destroys them, for example, at the request of a system administrator. When a server destroys a servlet, the server runs the servlet's destroy method. The method is run once; the server will not run that servlet again until after the server reloads and reinitializes the servlet. When the destroy method runs, another thread might be running a service request. The Handling Service Threads at Servlet Termination lesson shows you how to provide a clean shutdown when there could be long-running threads still running service requests.
it is a life cycle to them or their life.
A moth has a 4-stage life cycle.
the life cycle for horses are for all breeds. it is a dumb life cycle
what is a plums life cycle
cougars life cycle === ===
what is the wetas life cycle
what is a plums life cycle
The role of the fruit in a plant's life cycle is reproduction , in some plants it signals the end of the cycle.
Software life cycle model is a descriptive and digramatic representation of the software life cycle.
explain the destination life cycle explain the destination life cycle