"Craig R. McClanahan" wrote:
 
> How about, as a compromise, we emulate the java.util.ResourceBundle family and
> have it accept input information either way (properties files or XML files)?
> This would be pretty simple to implement.
> 
> The reason for this is that I've heard just as many complaints about the
> property file format, especially in having to remember to run native2ascii on
> them -- to say nothing of some translators that screw up the format with their
> text editors.

Craig, 

I would like to further propose on this idea - create a
MessageResourcesInterface that various implementations can be created for.  Four
standard implementations could ship with struts: XML, Properties, and database. 
I could see that some people may find it easier, or more practical to store
their messages in a database.

There would need to be a mapping in a struts configuration file.  Something
like:

<messageresource name="en_us" source="messages.xml"
        class="org.apache.struts.XMLMessageResource" />

or

<messageresource name="en_us" source="messages.properties"
        class="org.apache.struts.PropertiesMessageResource" />

or

<messageresource name="en_us" source="jdbcpool_connection_name"
        table="MessageTable"
        class="org.apache.struts.DatabaseMessageResource" />


This would also give the developer an option to create their own if if they
implemented the MessageResourcesInterface.

Just my 0.02 worth.

Evan Vaala


P.S.  I would also like to see similiar interfaces and implementations for
templates and actions.  However a properties resource may be too simplistic for
templates and actions.  I do like the Pet Store "screendefinitions.xml" for
templates and "requestmappings.xml".  From what I can tell,
"requestmappings.xml" is similiar to struts action-mappings found in
struts-config.xml samples.

One thing that I like in JPS's requestmappings.xml is that you can direct the
url directly to a screen definition, or the url can be directed to a request
handler first, which I believe to be synonymous with structs action mapping.

Can struts also map a url directly to a screendefinition/template, or does it
only map actions?

Thanks!

Reply via email to