James Mitchell wrote:
> What is it?
> -----------
> If you've followed recent discussions on the struts-user list.  There has
> been a flurry of discussion over getting ApplicationResources messages from
> a database.

Well done James!

>   - Changes are immediately available to your application, when using OJB's
>     persistence broker to modify them.  (I will have samples of doing this
> soon.)

Now thats a handy feature.

> ToDo Items:
> -----------
>  - Conversion utility to parse a .properties file and create a .sql file.

I used Ant's <replaceregexp> to build the file I needed (it wasn't a 
.sql, but a .xml file - I'm using a different O/R tool).  It was quite 
simple and I could provide an example of this if folks are interested.

>  - Support for GlobalDebugMode, when this is enabled, all messages
>    are returned as "###" or some configurable value.
> 
>      This helps on large projects when, under pressure of time contraints,
>      developers quickly (and without meaning to - Honest;) hard code values
>      while cranking out code, and can assist in quickly determining if all
>      messages are actually coming from the bundle.

Indeed this is very handy, but there is one gotcha here, and I had to 
make a special case in my DbResources implementation to account for it. 
  The org.apache.struts..[can't remember the exact details].format keys 
that the <bean:write> tag looks for must return null or a valid 
formatting string.  I just coded a 
key.startsWith("org.apache.struts....") special case to ensure it 
returns null if the key is not found, rather than my regular default 
value of not found keys of "<locale> : <config> : <key>".

A debug mode would be handy, and it was quite interesting to see my 
first iteration of my DbResources which did not do database lookup but 
rather returned the key it was looking up.  It made it readily apparent 
where we were using resources and where strings were hardcoded in the JSP.

        Erik



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

Reply via email to