how a servlet is instantiated, whether the container calls
init() or by calling any other method? please somebody reply..
Answer Posted / nishidh soni
Servlet is initialized by two ways...
1)By initializing the constructor:-but in the initial version of JDK 1.0 constructor can not be initialized for the dynamic page loading so that init() method for the servlet comes into the picture.
2)By invoking the init() method:-This init() method is invoked by the servlet container at it is invoked once per servlet and it uses the ServletConfig as a object for the initialized parameter.and the it is like
init(ServletConfig config)
{
.....
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Explain request dispatcher and its methods.
What do you mean by httpservlet?
How do I support both get and post from the same servlet?
What is webservlet?
What are the different types of servlets?
What is the importance of init() method in Servlet ?
What are the features added in Servlet 2.5?
How can you push data from an Applet to a Servlet?
Explain the custom jsp tags and the beans.
How do you find out what client machine is making a request to your servlet
Why servlet is used as controller ? Not JSP? I want complete explation?
What is meant by Servlet? What are the parameters of service method?
What are the new features added to servlet 2.5?
Can we override destroy method in servlet?
What is the difference between servlet and jsp?