Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How servlet is created?

1126


How the typical servlet code look like ?

1152


What are the advantages of cookies?

1073


Difference between GET and POST?

1098


What are the functions of the servlet container?

1564


What is called servlet container?

1046


What is MIME Type?

1102


What is the difference between the http servlet and generic servlet?

1098


What is the capacity the doget can send to the server?

1028


What is a deployment descriptor?

1061


What is the difference between the getrequestdispatcher(string path) method of javax.servlet.servletrequest interface and javax.servlet.servletcontext interface?

994


What is the difference between CGI and Servlet?

1018


How do you invoke a Servlet? What is the difference between doPost method and doGet method?

1094


How to find whether a parameter exists in the request object?

1062


How the servlet is loaded?

1025