struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Mitchell" <>
Subject DBMessageResources status and questions
Date Fri, 06 Sep 2002 07:46:15 GMT
I apologize ahead of time for my confusion/misunderstanding/stupidity ;)

As you may have read recently, I am attempting to tackle a
DBMessageResources implementation, but I am bumping into a couple of issues
related to struts design.

My first DBMessageResources is working fine now.  I have created the sql
scripts and code necessary to run the struts-example using a database
instead of a properties file.  The only changes were to add the class files
and change one line in the struts-config.xml.  It works fine.

>From what I can tell, struts assumes that all MessageResources are cached in
memory.  If this were not true then there would be some way for my code to
tell what sub-app was picked.

So, if my code were to try and get data based on 1)key, 2)locale, and
3)module, there is no way for me to know #3.  This means that my
implementation must retrieve and store the data (HashMap) based on #1 and #2
which eliminates using it in any app other than the default (unless I hard
code it as part of 'parameter' in the struts-config-subapp.xml).

The dtd allows me to specify:

 <message-resources className="some.subclass.of.MessageResourcesConfig" ...
    <set-property property="subapp" value="something"/>

However, MessageResourcesConfig is neither passed on the constructor or
available through some other means, so I would have to do this...


and worry about parsing it out later (ick, I hate this).

-Am I missing something here?  Is there some way to get at servletContext,
 ApplicationConfig, or even MessageResourcesConfig????

I've also got plans for XMLMessageResources, but I think that I will have
the same issues with it as well.

Sorry for the long post.
I would appreciate any enlightening you can give.

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message