Here is something gone wrong.

Why should a 'normal' Java class do not have a constructor? (see
OO-basics)

next should be a look at the docs :
"
public GenericServlet()
        Does nothing, because this is an abstract class. All of the
servlet initialization is done by one of the init methods.

public void init(ServletConfig <../../javax/servlet/ServletConfig.html>
config)
          throws ServletException
<../../javax/servlet/ServletException.html>
        Initializes this servlet.
        The servlet engine calls this method once, automatically, each
time it loads the servlet. This method is guaranteed to finish before
the servlet accepts any requests to its service method. If a fatal error
occurs while the servlet is being initialized, the servlet engine should
throw an UnavailableException, rather than calling the System.exit
method.
        The init method stores the ServletConfig
<../../javax/servlet/ServletConfig.html> object it receives from the
servlet engine. If you override init, you should either call super.init
or store the ServletConfig object in the new init method. If you decide
to store the ServletConfig object in a different location, you should
also override the getServletConfig()
<../../javax/servlet/GenericServlet.html> method.

"


/*************************/
 Thomas Schuchert
 Cyberconsult
 Beratungsgesellschaft f�r Neue Medien mbH
 [EMAIL PROTECTED]
 030 - 39 99 05 46
/*************************/


> -----Urspr�ngliche Nachricht-----
> Von:  Farooq Hameed [SMTP:[EMAIL PROTECTED]]
> Gesendet am:  Donnerstag, 27. April 2000 14:40
> An:   [EMAIL PROTECTED]
> Betreff:      Re: Constructors in Servlet
>
> No, there are no constructors and destructors in servlets. But there
> are two
> methods init() and destroy() that can be used as constructor and
> destructor
> respectively.
>
> When servelt's instance is instantiated,   init() is called
> immediately so you
> can use it as constructor and you can do default initialization of
> variables
> etc.
> When servlet is destroyed, destroy() method is called (ofcourse when
> webserver
> is restarted.) and you can do clean up in this one.
>
>
> Regards
> Farooq Hameed
>
>
>
>
>
> Sanjay Kumar <[EMAIL PROTECTED]> on 04/27/2000 05:43:40 PM
>
> Please respond to "A mailing list for discussion about Sun
> Microsystem's Java
>       Servlet API Technology." <[EMAIL PROTECTED]>
>
> To:   [EMAIL PROTECTED]
> cc:    (bcc: Farooq Hameed/CresSoft)
>
> Subject:  Constructors in Servlet
>
>
>
> Hello friends,
>     Is it possible to have constructors  in Servlets?
>     If yes when is it called?
>
> Waiting for your valuable suggestion.
>
> Thanks
> Sanjay
>
> ______________________________________________________________________
> _____
> 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
>
> ______________________________________________________________________
> _____
> 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

___________________________________________________________________________
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