You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Konstantina Stamopoulou <st...@intracom.gr> on 2002/02/05 13:43:01 UTC
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Database Servlet
Posted by Robert Scaduto <rs...@douwantit.com>.
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:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>