Re: need some explanations
Vilavanh Messien wrote: > Actually, I'm using Tomcat 3.2. > If the prob comes from Tomcat, why the struts example has no trouble with it > ? > The bug doesn't bite everyone -- whether or not your struts-example gets shut down correctly or not depends on what other web apps are defined in the same Tomcat installation (technically, it depends on the order in which the web apps are enumerated in a Hashtable, plus which JVM you are running). At any rate, the only damage this bug does is it will fail to save any changes to the "users" or "subscriptions" that took place. The application itself still works OK. Of course, as others have pointed out, this is only an example app anyway -- a real system would use a database. I just wanted something self contained, that would run "out of the box" in most circumstances. Craig
RE: need some explanations
Actually, I'm using Tomcat 3.2. If the prob comes from Tomcat, why the struts example has no trouble with it ? -Message d'origine- De : Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Envoyé : 24 novembre, 2000 16:00 À : [EMAIL PROTECTED] Objet : Re: need some explanations Vilavanh Messien wrote: > 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. > Tomcat 3.2, right? There was a bug in Tomcat that causes this. It was recently fixed, and will work correctly in the upcoming final release. > > Thanks > Craig > > -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 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
Re: need some explanations
Vilavanh Messien wrote: > 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. > Tomcat 3.2, right? There was a bug in Tomcat that causes this. It was recently fixed, and will work correctly in the upcoming final release. > > Thanks > Craig > > -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 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
RE: need some explanations
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 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
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 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
RE: need some explanations
Thanks for your advice ! Nevertheless, I'd like to understand the mechanism used in the example. The load() method of DatabaseServlet is called during the init(). Thats'ok. But I don't know how to pass my parameters to the servlet in order to store them in a file. Could you explain me how it works ? -Message d'origine- De : Jim Richards [mailto:[EMAIL PROTECTED]] Envoyé : 23 novembre, 2000 20:40 À : [EMAIL PROTECTED] Objet : Re: need some explanations It's really only for an example. It you want real object persistence, you'll need to develop your owne layer. Something like EJB's will make this much, much easier. Or some direct JDBC code perhaps. 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 ? > > How can I do to pass some arguments to the DatabaseServlet ? > > Thanks > > Vilavanh
Re: need some explanations
It's really only for an example. It you want real object persistence, you'll need to develop your owne layer. Something like EJB's will make this much, much easier. Or some direct JDBC code perhaps. 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 ? > > How can I do to pass some arguments to the DatabaseServlet ? > > Thanks > > Vilavanh
need some explanations
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 ? How can I do to pass some arguments to the DatabaseServlet ? Thanks Vilavanh