Atul wrote:
>
> Why has Java gone for init() in both cases? I can
> do the initialization in the constructor.
>

 You generally need a ServletConfig argument. But
javax.servlet.Servlet is an interface, and interfaces
can't declare constructors. You could have a convention
that servlets had to declare a ctr that took a config
argument, but there wouldn't be any compile-time checking.
Plus, ancient versions of the JDK had no way for user
code to invoke ctr's on dynamically loaded classes.



--
Christopher St. John [EMAIL PROTECTED]
DistribuTopia http://www.distributopia.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to