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
Which java application server is the best?
What are different ways for authentication of servlet?
How the typical servlet code look like ?
Differentiate between the get and post method
What is the requirement of servlet config and servlet context implemented and how are they implemented?
What is the difference between servlet and jsp?
How to rectify errors in java servlet while compilation?
Explain servlet.
What is the difference in between the httpservlet and generic servlet?
Which event is fired at the time of setting, getting or removing attribute from application scope?
What do you mean by web applications?
What is session tracking?
What is the need of session tracking in web application?
how to link html file to sevlet file.one name is textbox,c&c++ is cheakbox,bc&mca is radio button and one submit buttonis ok why in this programme use in servelt file
The code in a finally clause will never fail to execute, right?