You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Daniel Jue <te...@gmail.com> on 2006/08/01 00:53:14 UTC
Reading a file for initialization
Hello,
If I get some answers to this, I hope it can serve as a simple guide to
newbies like myself. I'm not entirely sure of my approach, so feel free to
interject your thoughts if you care to enlighten me.
I have a large amount of application settings stored in an XML file (so
large that I don't want to embed them in a java class), that is in a folder,
e.g.:
context/settings/MenuSettings.xml
My class that wants to read this file is:
context/WEB-INF/classes/MyPackage/AppSettings.class
And the AppSettings class contains a static instance of itself, for Tapestry
components/POJOs to reference.
Let's say I use something like Xerces to reading the xml file in, and lets
say that works fine using the main() in AppSettings.
So right now I get the feeling the MenuSettings.xml is not and shouldn't be
a Tapestry asset, since a Tapestry component is not directly accessing it.
What is the best-practices way of getting a non-Tapestry initilization file
read?
i.e. what path would I use to read MenuSettings.xml from the AppSettings
class?
I've read one thread that suggested extending some base engine class, but is
there a simpler way?
Thanks for reading,
-Daniel
Tapestry 4
Tomcat 5.5