Is there any way to statically access fields from resources defined in Struts?
In other words, I would to be able to access terms stored in properties files without needing a ServletRequest. My application exists within a servlet container, and utilizes Struts. However, I have processes running that are independant of incoming requests.
The commons-resources project is intended to provide a generalized framework for handling messages like this; it was factored out of Struts, and one day, perhaps Struts will depend upon it in favor of the original implementations.
I don't think commons-resources has seen a full 1.0 release yet, but it's usable.
The Spring Framework also provides a generalized message resource handling mechanism which is well suited to use independently from the Servlet API. Spring, of course, has seen a full release, and is closing in on its 1.2 release. Of course, it carries with it a lot more than just message handling, but you can selectively install sub-jars if you don't want to carry around the whole thing (or risk your team depending on some part of it that you aren't ready to depend upon just yet.)
Either of these would require some more set-up to make the resources available, but either should be fairly straightforward to implement. Spring makes it trivial to provide your business layer classes with implementations of the resource loader, as long as you let it manage those classes.
Joe
--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Narrow minds are weapons made for mass destruction" -The Ex
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]