Arrrrrgh! I just can't believe that this is hard! (Or perhaps it's just me that finds this hard. That's not so difficult to believe.)
OK, so, the J2EE application we are working on needs some configuration, so I've monkied up a quick Digester based configuration file reader. That should have been the hard bit, but it's been a piece of cake. Digester is great!
I've currently got this file in
WEB-INF/config.xml, which feels right. But Tomcat can't find it given just this as a file path. I suppose that I need to prepend the document root to this - but how do I find that? (I'm currently trying to read this file in a
Naturally, I'd rather not use anything Tomcat specific if I can help it. But I did try this:
But unluckily (or perhaps luckily) this didn't work. It *would* work from a Servlet, I think, but the
org.apache.catalina.resources context attribute doesn't seem to exist as the context is initialised.
Arrrrrgh!Posted to Java by Simon Brunning at February 24, 2004 12:49 PM