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
What is the difference between the include() and forward() methods?
Write all the phases defined in servlet life cycle?
What is the purpose of requestdispatcher interface?
What if you need to span your transaction across multiple servlet invocations?
How can we achieve transport layer security for our web application?
When to use doget() and when dopost()?
What is a web container and what is its responsibility?
Explain in brief the directory structure of a web application?
Why is servlet used?
When is the servlet instance created in the life cycle of servlet? What is the importance of configuring a servlet?
What is ServletContext object?
How the JSP file will be executed on the Server side?
What is meant by servlet? What are the parameters of the service method?
Why do we have servlet wrapper classes?
What is the servletconfig object?