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

Difference between httpservlet and generic servlets?

1050


How many servlet objects are created?

1018


What is cgi?

955


What is war file?

1030


Can we fetch the attributes related to a servlet on a different servlet?

1092


What is servlet in simple terms?

977


How do I use cookies to store session state on the client?

912


What are the types of protocols supported by httpservlet ?

1176


What are the phases of the servlet life cycle?

1065


Explain the differences between jsp and servlet.

945


What is servlet and its life cycle?

1080


How can the session in servlet be destroyed?

1108


What is the use of attribute in servlets?

1007


What is the difference between jsp and servlet life cycle?

1180


How to read request headers from servlets?

1002