Answer Posted / shakir khan
javax.servlet.Servlet interface defines 3 methods known as
life cycle.
Servlet intialisation takesplace every first time,it
receives a request and remains in memory till times out or
server shutdown
When first request came in for a servlet,servlet invoke
init() only once.
public void init(ServletConfig config)
{
}
Thereafter if any user wants requet,it will directly
executes the service().
public void service(ServletRequest req,ServletResponse res)
throws servletException,IOException
{
}
When server wants to remove the servlet from pool ,it will
executes the destroy().
public void destroy()
{
}
| Is This Answer Correct ? | 14 Yes | 2 No |
Post New Answer View All Answers
Describe servlet?
How can the session in servlet can be destroyed?
What is the difference in between the httpservlet and generic servlet?
What is java servlet?
What is the difference between get and post methods?
What are different Authentication options available in Servlets.
Why doesn’t a servlet include main()? How does it work?
Which method is called when reference variable is passed in system.net?
How do I know if java is running on linux?
What's the use of servletcontext?
When a client request is sent to the servlet container, how does the container choose which servlet to invoke?
Can you create a deadlock condition on a servlet?
How can we create deadlock situation in servlet?
What is the default http method in the servlet?
How can an existing session be invalidated?