struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Cooper" <martin.coo...@tumbleweed.com>
Subject RE: DBMessageResources status and questions
Date Fri, 06 Sep 2002 22:39:30 GMT
James,

Have you taken a look at the Resources package in the Commons sandbox? At
some point in time, when that is complete, we expect to migrate Struts to
use that, instead of having our own implementation here.

Of particular interest to you might be the (not really finished) web
variants, which provide for a ServletContext to be supplied. There's also a
very simplistic XML implementation, although that will likely be ripped out
and replaced with something configurable, perhaps using Betwixt.

--
Martin Cooper


> -----Original Message-----
> From: James Mitchell [mailto:jmitchtx@telocity.com]
> Sent: Friday, September 06, 2002 12:46 AM
> To: Struts Developers List
> Subject: DBMessageResources status and questions
> 
> 
> 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.
> 
> Status:
> ------
> 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.
> 
> Assumption:
> ----------
> 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...
> 
>   <message-resources
>        	
> factory="org.apache.struts.util.DBMessageResourcesFactory"
>       parameter="something.DBMessageResources"/>
>                  ^^^^^^^^^
> 
> and worry about parsing it out later (ick, I hate this).
> 
> 
> Questions:
> ---------
> -Am I missing something here?  Is there some way to get at 
> servletContext,
>  ApplicationConfig, or even MessageResourcesConfig????
> 
> 
> Future:
> ------
> 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"
> http://www.open-tools.org/struts-atlanta
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:struts-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:struts-dev-help@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@jakarta.apache.org>


Mime
View raw message