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...

Hi guys.. Well can u tell me that why there is need of
"init()" , i mean why can not we initialize the servlet object
with the help of constructors?
Thank you.

Answer Posted / abhijit mishra

As per Servlet specification, the servlet container is
responsible for creating the servlet and initializing it( or
making it ready for client to request it).

So according to the Client:servlet container contract, the
servlet creation and inialization is done by the container
which will differ for different container provider.

So u can't use constructors to create servlets.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the structure of the http response

1220


What are different methods of session management in servlets?

1328


What is cgi?

1066


How can the session in servlet be destroyed?

1207


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

1163


What are the different methods involved in the process of session management in servlets?

1343


Differentiate between the get and post method

1118


How to get the actual path of servlet in server?

1271


Explain the methods of request dispatcher in servlet?

1099


What are the benefits of using servlet over cgi?

1127


Is servlet a server side scripting language?

1188


The code in a finally clause will never fail to execute, right?

1149


What are the uses of servlet and what is servlet chaining?

1147


Which protocol will be used by browser and servlet to communicate

1106


What are the steps that are involved in using the httpservlet class?

1183