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

how many jsp scripting elements are there and what are those?

1019


What is called a session?

1176


Explain the difference between a web server and a web container?

1010


What is meant by a web application

1021


What is the servletconfig object?

1045


Explain in brief the directory structure of a web application?

1112


Why do we have servlet filters?

1028


What is the use of servlet context?

1045


How to handle exceptions thrown by application with another servlet?

1091


What is cgi and what are its drawbacks?

1070


What is a deployment descriptor?

1107


Which method is called when reference variable is passed in system.net?

2408


Which protocol will be used by browser and servlet to communicate

1059


What is difference between GenericServlet and HttpServlet?

1174


What is difference between get and post method?

1080