Here's what I do:

    - Plugin uses digester to load config into bean instances.
    - Place the overall container into application scope under a known key.

I don't particularly care of the Struts approach of "declare a constant 
in some distant package for this key", as, at best, it causes the 
introduction of a run-time expression (at least that's the way I've 
found to do it - someone please tell me if there is a better way).  I 
just defined a key under which my config could be found -- and I stick 
to it everywhere.  I wish struts would adopt this approach ...

The top-level object in my graph is a ModuleManager instance.  Once that 
is initialized, I poke it out into application scope under the key of 
"moduleManager".

I suppose Struts uses the keys it does so that it doesn't trample on 
folks names-space.  Personally, I'd give up what insignificant amount of 
namespace Struts would require -- just to have the keys more easily 
accessible.  (hrm ... application config in app scope under "appCfg" or 
"strutsAppCfg" or the like .. same deal on mappings ... resources ... hrm)

Day, Michael-IBM/TT wrote:

>Both are much easier than I thought.  Thanks for the help.  One question remains: if 
>I were to have a ConfigurationPlugIn, for example, how would I get that information 
>to each servlet.  Should I create static method within the ConfigurationPlugIn class 
>that returns an object with all of the config values?
>

-- 
Eddie Bush




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to