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

What is URL Encoding?

1280


Explain servlet life cycle?

1188


What is a servlet-to-servlet communcation?

1259


How can the referrer and the target urls be used in servlet?

1061


Explain url encoding?

1037


What are the uses of servlets?

1225


What is servlet invoker?

1087


What are the phases of the servlet life cycle?

1186


What is pure servlet?

1256


What are the types of Session Tracking ?

1211


What is the web server used for running the Servlets?

1064


Can we use threads in Servlets?

1192


Describe the phases of servlet lifecycle?

1130


Servlet is pure java object or not?

1242


What is servlet instance?

1100