struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Scaduto" <rscad...@douwantit.com>
Subject RE: Database Servlet
Date Tue, 05 Feb 2002 18:43:45 GMT
You could keep a reference to the last modified date of the xml file when
you init the servlet and then check the timestamp every time your main page
runs.  If it changes the re-run the digester.

-or-

If you don't have access to the timestamp then, you could refresh at
periodic intervals on a different thread. And then replace the old java
beans in the ServletContext.

-or-

You can read the file every time if the page needs to be in sync at all
times. This is the most accurate solution but not the most efficient.

Hope this helps,

Rob

-----Original Message-----
From: Konstantina Stamopoulou [mailto:stak@intracom.gr]
Sent: Tuesday, February 05, 2002 7:43 AM
To: Struts Users Mailing List
Subject: Database Servlet


Hello,

I apologize if my question sounds naive but I really need your help on this.
 I have a servlet that during initialization parses an .xml file using
Digester. Then I access the data in  my jsps through JavaBeans. What I need
to do, is to have my main page which displays the data from the .xml to be
updated with the new data each time the .xml is modified.
In order to do this, do I have to put the code of the init() method of my
servlet in the Action class of the main page or is it a more elegant way to
do this?

Thank you  in advance,
Konstantina


--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message