If I understand, destroy() should be called when the servlet container (i.e
Tomcat) is shutdown.
But, in my small application, destroy() seems not to be called so that
information cannot be
written database.xml.
I didn't manage to find where my error is.
Thanks
-----Message d'origine-----
De : Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Envoy� : 24 novembre, 2000 15:33
� : [EMAIL PROTECTED]
Objet : Re: need some explanations
Vilavanh Messien wrote:
> I analyzed the struts example in order to develop my own small
application.
> Unfortunatelaty, I don't really understand how the user's information are
> saved
> in the "database.xml" file.
> The DatabaseServlet must write the information in the "database.xml" when
> the destroy() method
> is called.
> My question is how to make the destroy() method perform ?
>
The destroy() method is called by the servlet container, when it removes
this
servlet from service or when the application is shut down. Typically,
server
shutdown is the *only* time that a servlet is removed and destroy() is
called.
>
> How can I do to pass some arguments to the DatabaseServlet ?
>
This is done by adding <init-param> entries in the WEB-INF/web.xml file.
See
the Servlet API Specification, version 2.2, for the details -- you can
download
it at:
http://java.sun.com/products/servlet/download.html
There are also a growing number of articles and books covering the servlet
2.2
API that discusses this kind of thing. I would try looking for "web.xml" in
your favorite search engine, as a starting point.
>
> Thanks
>
> Vilavanh
Craig McClanahan