On Thu, 29 Aug 2002, Mark Kaye wrote:

> Date: Thu, 29 Aug 2002 16:09:24 +0100
> From: Mark Kaye <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: RE: AW: ApplicationResources.properties to DB?
>
> > -----Original Message-----
> > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> >
> > If you (or anyone else) actually builds one of these things,
> > I'll happily post it into the "contrib" area so that it gets
> > included in the source distribution ....
>
> That would be great.  I was thinking that this would be an ideal
> solution for my work too.  I wonder what the differences would be
> between parsing a very large ApplicationResources.properties and a
> database table with the appropriate entries.  I assume that all this
> stuff is cached at startup by Struts.  Is this the case?
>

<star-wars-reference>
Use the Source, Luke ...
</star-wars-reference>

In particular, the sources to the following org.apache.struts.util classes
will be very useful to you:
- MessageResources
- MessageResourcesFactory
- PropertyMessageResources
- PropertyMessageResourcesFactory

The default implementation (PropertyMessageResources) caches the resources
in memory the first time you access a particular file.  The proposed
JDBCMessageResources would have to make its own decisions about whether to
cache or not -- perhaps as a configuration option.

You would probably also want to be flexible about how the database
connection is established, what the table and column names are, and so on
-- for some ideas about configuration, take a look at how JDBCRealm is
configured in Tomcat.

Craig


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

Reply via email to