ServletContextListener that initializes and finalizes the
persistent storage of User and Subscription information for the Struts
Demonstration Application, using an in-memory database backed by an XML
file.
IMPLEMENTATION WARNING - If this web application is run
from a WAR file, or in another environment where reading and writing of the
web application resource is impossible, the initial contents will be copied
to a file in the web application temporary directory provided by the
container. This is for demonstration purposes only - you should
NOT assume that files written here will survive a restart
of your servlet container.
This class was borrowed from the Shale Mailreader. Changes were:
- Path to database.xml (under classes here).
- Class to store protocol list (an array here).
DEVELOPMENT NOTE - Another approach would be to instantiate the database via Spring.
|