how a servlet is instantiated, whether the container calls
init() or by calling any other method? please somebody reply..

Answer Posted / ashutosh

Servlet is instantiated by servlet container by calling
method Class.forName(Servlet class name).newInstance();

First of all Servlet Container looks into the
deployment descriptor(web.xml) .It looks the definition of
Servlet.And Than instantiate it by calling
Class.forName(Servlet class name).newInstance();

Is This Answer Correct ?    19 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What exception should be thrown when servlet is not properly initialized?

555


What are the different session tracking techniques?

681


What are the different types of servlets?

518


What is a web application and what is it’s directory structure?

585


I have a requirement Here we have a ResultSet object that will contain 50 records i need to print those recors in to a webpage(i.e; view according to MVC architectures that mybe servlet or jsp) . Here i need to print the records 10 per page that is 1 to 10 in page one and 11 to 20 in page two like remaining will be appeared in other pages we need to display those page numbers whenever we click on that page number we will go to that page and display 10 records like we will display 5 pages it is like this << 1 2 3 4 5 next >>

2533






What is the major difference between servlet and applet?

540


Why doesn’t a servlet include main()? How does it work?

633


How to get the actual path of servlet in server?

739


What do you mean by chaining in servlet?

576


Define the servlet mapping.

548


Explain servlet life cycle?

619


What is difference between cookies and httpsession?

546


What are the advantages of cookies?

632


How can we upload the file to the server using servlet?

544


Explain the war file?

612