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
Why is servlet used?
What are the exceptions thrown by servlets? Why?
What is the directory structure of a war file?
How many servlet objects are created?
How do we call one servlet from another servlet?
Why is httpservlet declared abstract?
What are the benefits of using servlet over cgi?
How do you create a cookie using servlet?
What are the uses of servlets?
What is cgi and what are its drawbacks?
Is servlet a controller?
Once the destroy() method is called by the container, will the servlet be immediately destroyed? What happens to the tasks(threads) that the servlet might be executing at that time?
What is servlet and how it works?
How to notify an object in session when session is invalidated or timed-out?
How do you configure a centralized error handler in servlets?