You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by ma...@tumbleweed.com on 2001/10/11 08:08:20 UTC

[PROPOSAL] XMLMessageResources

The Struts 1.1 TODO list contains the following item:

"XmlMessageResources. Implementation of MessageResources and
MessageResourcesFactory that loads message keys and strings from one or more
XML resources or files."

I have an implementation of this which I would like to contribute to Struts.
The implementation is a drop-in replacement for the existing
PropertyMessageResources. In fact, it is derived from it, and so shares the
same file naming scheme for locale-specific messages.

Here's a simple example of what an XML message file would look like:

---------- begin example ----------
<?xml version="1.0" encoding="ISO-8859-1"?>

<messages>
  <message key="validation.username.required">You must enter a
username</message>
  <message key="validation.password.required">You must enter a
password</message>
  <message key="validation.password.match">Confirmation password does not
match</message>
</messages>
---------- end example ----------

The first line of the example provides a hint as to why I did not attempt to
incorporate messages for more than one locale into a single XML file.
Messages for different locales may well be specified using different
character encodings. In addition, maintaining the messages from each locale
in a different XML file avoids loading locales unnecessarily.

To use this implementation, all that is required is to specify the 'factory'
init-param in your web.xml file, and to make sure that the 'application'
init-param refers to an XML resource.

What do people think about incorporating this into the Struts 1.1 code base?

--
Martin Cooper





Re: [PROPOSAL] XMLMessageResources

Posted by ma...@tumbleweed.com.
Do you mean having one bundle (from the Struts naming perspective) comprised
of messages from multiple properties files or XML files? Good idea. I'll
give that some thought as I look into the Commons resources project.

--
Martin Cooper


----- Original Message -----
From: "Ted Husted" <hu...@apache.org>
To: <st...@jakarta.apache.org>
Sent: Saturday, October 13, 2001 2:58 AM
Subject: Re: [PROPOSAL] XMLMessageResources


> Can we join this with the idea of having multiple Struts configuration
> files, or, on a related front, multiple workflow configuration files?
>
> martin.cooper@tumbleweed.com wrote:
> >
> > The Struts 1.1 TODO list contains the following item:
> >
> > "XmlMessageResources. Implementation of MessageResources and
> > MessageResourcesFactory that loads message keys and strings from one or
more
> > XML resources or files."
> >
> > I have an implementation of this which I would like to contribute to
Struts.
> > The implementation is a drop-in replacement for the existing
> > PropertyMessageResources. In fact, it is derived from it, and so shares
the
> > same file naming scheme for locale-specific messages.
>
> "SCHACHTER,MICHAEL (HP-NewJersey,ex2)" wrote:
> >
> > Martin,
> >
> > In the jakarta-commons-sandbox, there's a folder
> > called "resources" containing Struts MessageResources
> > and some other classes that I was working on, but had
> > to put off for a while.



Re: [PROPOSAL] XMLMessageResources

Posted by ma...@tumbleweed.com.
In my particular case, I need more fine-grained control than this would 
give me. For example, the application I am building includes a main menu 
which contains items from all of the installed products. In some cases, I 
have tabbed pages where the tabs come from different products.

Separate web apps are too separate to support this (unless there's 
something I'm missing). However, I should be able to use a single Struts 
application, as long as I can load multiple config files (as well as 
multiples of other things).

As for using an EAR file, well, that would require that I switch to a full 
J2EE container to get that support. :-)

If I *am* missing something, and there is a way to do this kind of thing 
with separate WAR files, I'd definitely be interested in knowing more.

--
Martin Cooper


At 05:30 AM 10/16/01, Petr Jiricka wrote:
>What is the advantage of having multiple struts-config files over a model
>where you develop multiple Web Modules (.war files) and distribute them
>together in an .ear file (per the J2EE specification) ? I think the goal of
>the Web Module design was to support exactly this scenario. How do you think
>the J2EE specification would need to be enhanced to conveniently support
>this case ?
>
>Petr
>
>----- Original Message -----
>From: <ma...@tumbleweed.com>
>To: <st...@jakarta.apache.org>
>Sent: Sunday, October 14, 2001 6:57 AM
>Subject: Re: [PROPOSAL] XMLMessageResources
>
>
> > Personally, I am firmly in the second camp (reading multiple config
>files).
> > My reasoning is as follows.
> >
> > I am working on a large project that will result in a common framework,
>and
> > product modules which plug in to that framework. The common framework, and
> > all of the product modules, will use Struts. Product modules can be
> > installed and uninstalled by our customers.
> >
> > Using some kind of 'include' mechanism solves the problem of different
> > product teams stepping on each others' toes when editing the Struts
> > configuration. However, it makes installation and uninstallation somewhat
> > harder, because those applications will have to understand the structure
>of
> > the Struts configuration file.
> >
> > Using multiple configuration files allows me to have one config file for
>the
> > common framework, and then one more for each product. Each product team
>can
> > concentrate on its own config file, and the installer and uninstaller only
> > have to worry about which files to add or remove, and not about what they
> > contain or how to modify them.
> >
> > --
> > Martin Cooper
> >
> >
> > ----- Original Message -----
> > From: "James Holmes" <jh...@yahoo.com>
> > To: <st...@jakarta.apache.org>
> > Sent: Saturday, October 13, 2001 4:29 PM
> > Subject: Re: [PROPOSAL] XMLMessageResources
> >
> >
> > > It seems there has been some discussion in the past
> > > about a new config file DTD that would support having
> > > "multiples" so that individuals could work on a
> > > particular section without affecting others.  It seems
> > > there is also the camp that would rather just have the
> > > servlet read multiple config files.  I am indifferent
> > > (at this point) to which solution i think should be
> > > adopted, but think that Struts could certainly be more
> > > "team development" friendly by choosing one and then
> > > offering it.  I have some extra bandwith and would
> > > like to get involved in the "core" struts development.
> > >  Craig/Ted/Others, I'd be happy to develop one or
> > > both.  I guess I'd like to know what people want to
> > > see developed and what has the highest likelyhood of
> > > being incorporated into Struts and I will develop it.
> > >
> > > What about the whole debate on multiple ActionServlets
> > > per WAR?  If I were to "solve" this would this be
> > > something that could go into the core?
> > >
> > > -james
> > > jholmes612@yahoo.com
> > > http://www.ejcenter.com/struts/
> > >
> > >
> > > --- Ted Husted <hu...@apache.org> wrote:
> > > > Can we join this with the idea of having multiple
> > > > Struts configuration
> > > > files, or, on a related front, multiple workflow
> > > > configuration files?
> > > >
> > > > martin.cooper@tumbleweed.com wrote:
> > > > >
> > > > > The Struts 1.1 TODO list contains the following
> > > > item:
> > > > >
> > > > > "XmlMessageResources. Implementation of
> > > > MessageResources and
> > > > > MessageResourcesFactory that loads message keys
> > > > and strings from one or more
> > > > > XML resources or files."
> > > > >
> > > > > I have an implementation of this which I would
> > > > like to contribute to Struts.
> > > > > The implementation is a drop-in replacement for
> > > > the existing
> > > > > PropertyMessageResources. In fact, it is derived
> > > > from it, and so shares the
> > > > > same file naming scheme for locale-specific
> > > > messages.
> > > >
> > > > "SCHACHTER,MICHAEL (HP-NewJersey,ex2)" wrote:
> > > > >
> > > > > Martin,
> > > > >
> > > > > In the jakarta-commons-sandbox, there's a folder
> > > > > called "resources" containing Struts
> > > > MessageResources
> > > > > and some other classes that I was working on, but
> > > > had
> > > > > to put off for a while.
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Make a great connection at Yahoo! Personals.
> > > http://personals.yahoo.com
> >
> >



Re: [PROPOSAL] XMLMessageResources

Posted by Petr Jiricka <pe...@czech.sun.com>.
What is the advantage of having multiple struts-config files over a model
where you develop multiple Web Modules (.war files) and distribute them
together in an .ear file (per the J2EE specification) ? I think the goal of
the Web Module design was to support exactly this scenario. How do you think
the J2EE specification would need to be enhanced to conveniently support
this case ?

Petr

----- Original Message -----
From: <ma...@tumbleweed.com>
To: <st...@jakarta.apache.org>
Sent: Sunday, October 14, 2001 6:57 AM
Subject: Re: [PROPOSAL] XMLMessageResources


> Personally, I am firmly in the second camp (reading multiple config
files).
> My reasoning is as follows.
>
> I am working on a large project that will result in a common framework,
and
> product modules which plug in to that framework. The common framework, and
> all of the product modules, will use Struts. Product modules can be
> installed and uninstalled by our customers.
>
> Using some kind of 'include' mechanism solves the problem of different
> product teams stepping on each others' toes when editing the Struts
> configuration. However, it makes installation and uninstallation somewhat
> harder, because those applications will have to understand the structure
of
> the Struts configuration file.
>
> Using multiple configuration files allows me to have one config file for
the
> common framework, and then one more for each product. Each product team
can
> concentrate on its own config file, and the installer and uninstaller only
> have to worry about which files to add or remove, and not about what they
> contain or how to modify them.
>
> --
> Martin Cooper
>
>
> ----- Original Message -----
> From: "James Holmes" <jh...@yahoo.com>
> To: <st...@jakarta.apache.org>
> Sent: Saturday, October 13, 2001 4:29 PM
> Subject: Re: [PROPOSAL] XMLMessageResources
>
>
> > It seems there has been some discussion in the past
> > about a new config file DTD that would support having
> > "multiples" so that individuals could work on a
> > particular section without affecting others.  It seems
> > there is also the camp that would rather just have the
> > servlet read multiple config files.  I am indifferent
> > (at this point) to which solution i think should be
> > adopted, but think that Struts could certainly be more
> > "team development" friendly by choosing one and then
> > offering it.  I have some extra bandwith and would
> > like to get involved in the "core" struts development.
> >  Craig/Ted/Others, I'd be happy to develop one or
> > both.  I guess I'd like to know what people want to
> > see developed and what has the highest likelyhood of
> > being incorporated into Struts and I will develop it.
> >
> > What about the whole debate on multiple ActionServlets
> > per WAR?  If I were to "solve" this would this be
> > something that could go into the core?
> >
> > -james
> > jholmes612@yahoo.com
> > http://www.ejcenter.com/struts/
> >
> >
> > --- Ted Husted <hu...@apache.org> wrote:
> > > Can we join this with the idea of having multiple
> > > Struts configuration
> > > files, or, on a related front, multiple workflow
> > > configuration files?
> > >
> > > martin.cooper@tumbleweed.com wrote:
> > > >
> > > > The Struts 1.1 TODO list contains the following
> > > item:
> > > >
> > > > "XmlMessageResources. Implementation of
> > > MessageResources and
> > > > MessageResourcesFactory that loads message keys
> > > and strings from one or more
> > > > XML resources or files."
> > > >
> > > > I have an implementation of this which I would
> > > like to contribute to Struts.
> > > > The implementation is a drop-in replacement for
> > > the existing
> > > > PropertyMessageResources. In fact, it is derived
> > > from it, and so shares the
> > > > same file naming scheme for locale-specific
> > > messages.
> > >
> > > "SCHACHTER,MICHAEL (HP-NewJersey,ex2)" wrote:
> > > >
> > > > Martin,
> > > >
> > > > In the jakarta-commons-sandbox, there's a folder
> > > > called "resources" containing Struts
> > > MessageResources
> > > > and some other classes that I was working on, but
> > > had
> > > > to put off for a while.
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Make a great connection at Yahoo! Personals.
> > http://personals.yahoo.com
>
>


Re: [PROPOSAL] XMLMessageResources

Posted by James Holmes <jh...@yahoo.com>.
I can work on getting patches for multiple Struts
configuration files to work.

How should we go about specifying the config files in
the web.xml file?  Here's a couple of ideas I have:

1.) Perhaps we could have them named config[x]
replacing "x" with a number.  I.e...

<init-param>
<param-name>config1</param-name>
<param-value>/WEB-INF/struts-config1.xml</param-value>
</init-param>
<init-param>
<param-name>config2</param-name>
<param-value>/WEB-INF/struts-config2.xml</param-value>
</init-param>


2.) Change the current "config" parameter to support a
comma delimited list of config files.  I.e...

<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config1.xml,/WEB-INF/struts-config2.xml</param-value>
</init-param>

What if anything should be done about duplicates
between files?  It appears that the current framework
allows duplicates.

As far as the DTD goes I agree wholeheartedly.  I
think we should change the root element to <struts>
and change the DOCTYPE to:

<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts
Configuration 1.2//EN"
         
"http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">

or we can leave it at 1.1, but let people with
existing snapshots know that their DTD is now
deprecated.

-james
jholmes612@yahoo.com
http://www.ejcenter.com/struts/


--- Ted Husted <hu...@apache.org> wrote:
> I agree with Martin, in that I think the most
> important thing is support
> for multiple Struts configuration files. 
> 
> The other piece to the puzzle is the Service
> Manager, since this lets
> you extend the ActionServlet without subclassing it,
> so that the modules
> could also configure their own services.
> 
> These two things together may be able to provide the
> solutions most
> people need when they ask for multiple
> ActionServlets. 
> 
> Encouraging multiple ActionServlets too soon could
> create a host of
> other problems. It may still be needed in some
> circumstances, but,
> personally, I think multiple configs and pluggable
> services is a cleaner
> approach, that will lead to applications that are
> easier to maintain. 
> 
> Ideally, it should also be possible to declare the
> validation, services,
> and messages from the same configuration file, to
> allow everything to be
> handled together. It's possible that we need to add
> a root element to
> the file, so that <struts-config> is only part of
> the scheme, and other
> configurations, like <form-validation> can be nested
> within.
> 
> <struts>
> <struts-config>
> ..
> </struts-config>
> <form-validation>
> ..
> </form-validation>
> <services>
> ..
> </services>
> <messages>
> ..
> </messages>
> </struts>
> 
> Of course, we should continue to et these be loaded
> as separate files
> too, as convenient to the developer.
> 
> 
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel +1 716 737-3463
> -- http://www.husted.com/struts/
> 
> 
> martin.cooper@tumbleweed.com wrote:
> > 
> > Personally, I am firmly in the second camp
> (reading multiple config files).
> > My reasoning is as follows.
> > 
> > I am working on a large project that will result
> in a common framework, and
> > product modules which plug in to that framework.
> The common framework, and
> > all of the product modules, will use Struts.
> Product modules can be
> > installed and uninstalled by our customers.
> > 
> > Using some kind of 'include' mechanism solves the
> problem of different
> > product teams stepping on each others' toes when
> editing the Struts
> > configuration. However, it makes installation and
> uninstallation somewhat
> > harder, because those applications will have to
> understand the structure of
> > the Struts configuration file.
> > 
> > Using multiple configuration files allows me to
> have one config file for the
> > common framework, and then one more for each
> product. Each product team can
> > concentrate on its own config file, and the
> installer and uninstaller only
> > have to worry about which files to add or remove,
> and not about what they
> > contain or how to modify them.
> > 
> > --
> > Martin Cooper
> > 
> > ----- Original Message -----
> > From: "James Holmes" <jh...@yahoo.com>
> > To: <st...@jakarta.apache.org>
> > Sent: Saturday, October 13, 2001 4:29 PM
> > Subject: Re: [PROPOSAL] XMLMessageResources
> > 
> > > It seems there has been some discussion in the
> past
> > > about a new config file DTD that would support
> having
> > > "multiples" so that individuals could work on a
> > > particular section without affecting others.  It
> seems
> > > there is also the camp that would rather just
> have the
> > > servlet read multiple config files.  I am
> indifferent
> > > (at this point) to which solution i think should
> be
> > > adopted, but think that Struts could certainly
> be more
> > > "team development" friendly by choosing one and
> then
> > > offering it.  I have some extra bandwith and
> would
> > > like to get involved in the "core" struts
> development.
> > >  Craig/Ted/Others, I'd be happy to develop one
> or
> > > both.  I guess I'd like to know what people want
> to
> > > see developed and what has the highest
> likelyhood of
> > > being incorporated into Struts and I will
> develop it.
> > >
> > > What about the whole debate on multiple
> ActionServlets
> > > per WAR?  If I were to "solve" this would this
> be
> > > something that could go into the core?
> > >
> > > -james
> > > jholmes612@yahoo.com
> > > http://www.ejcenter.com/struts/
> > >
> > >
> > > --- Ted Husted <hu...@apache.org> wrote:
> > > > Can we join this with the idea of having
> multiple
> > > > Struts configuration
> > > > files, or, on a related front, multiple
> workflow
> > > > configuration files?
> > > >
> > > > martin.cooper@tumbleweed.com wrote:
> > > > >
> > > > > The Struts 1.1 TODO list contains the
> following
> > > > item:
> > > > >
> > > > > "XmlMessageResources. Implementation of
> > > > MessageResources and
> > > > > MessageResourcesFactory that loads message
> keys
> > > > and strings from one or more
> > > > > XML resources or files."
> > > > >
> > > > > I have an implementation of this which I
> would
> > > > like to contribute to Struts.
> > > > > The implementation is a drop-in replacement
> for
> > > > the existing
> > > > > PropertyMessageResources. In fact, it is
> derived
> > > > from it, and so shares the
> > > > > same file naming scheme for locale-specific
> > > > messages.
> > > >
> > > > "SCHACHTER,MICHAEL (HP-NewJersey,ex2)" wrote:
> > > > >
> > > > > Martin,
> > > > >
> > > > > In the jakarta-commons-sandbox, there's a
> folder
> > > > > called "resources" containing Struts
> > > > MessageResources
> > > > > and some other classes that I was working
> on, but
> > > > had
> > > > > to put off for a while.
> > >
> > >
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Make a great connection at Yahoo! Personals.
> > > http://personals.yahoo.com




__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

Re: [PROPOSAL] XMLMessageResources

Posted by Ted Husted <hu...@apache.org>.
I agree with Martin, in that I think the most important thing is support
for multiple Struts configuration files. 

The other piece to the puzzle is the Service Manager, since this lets
you extend the ActionServlet without subclassing it, so that the modules
could also configure their own services.

These two things together may be able to provide the solutions most
people need when they ask for multiple ActionServlets. 

Encouraging multiple ActionServlets too soon could create a host of
other problems. It may still be needed in some circumstances, but,
personally, I think multiple configs and pluggable services is a cleaner
approach, that will lead to applications that are easier to maintain. 

Ideally, it should also be possible to declare the validation, services,
and messages from the same configuration file, to allow everything to be
handled together. It's possible that we need to add a root element to
the file, so that <struts-config> is only part of the scheme, and other
configurations, like <form-validation> can be nested within.

<struts>
<struts-config>
..
</struts-config>
<form-validation>
..
</form-validation>
<services>
..
</services>
<messages>
..
</messages>
</struts>

Of course, we should continue to et these be loaded as separate files
too, as convenient to the developer.


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/struts/


martin.cooper@tumbleweed.com wrote:
> 
> Personally, I am firmly in the second camp (reading multiple config files).
> My reasoning is as follows.
> 
> I am working on a large project that will result in a common framework, and
> product modules which plug in to that framework. The common framework, and
> all of the product modules, will use Struts. Product modules can be
> installed and uninstalled by our customers.
> 
> Using some kind of 'include' mechanism solves the problem of different
> product teams stepping on each others' toes when editing the Struts
> configuration. However, it makes installation and uninstallation somewhat
> harder, because those applications will have to understand the structure of
> the Struts configuration file.
> 
> Using multiple configuration files allows me to have one config file for the
> common framework, and then one more for each product. Each product team can
> concentrate on its own config file, and the installer and uninstaller only
> have to worry about which files to add or remove, and not about what they
> contain or how to modify them.
> 
> --
> Martin Cooper
> 
> ----- Original Message -----
> From: "James Holmes" <jh...@yahoo.com>
> To: <st...@jakarta.apache.org>
> Sent: Saturday, October 13, 2001 4:29 PM
> Subject: Re: [PROPOSAL] XMLMessageResources
> 
> > It seems there has been some discussion in the past
> > about a new config file DTD that would support having
> > "multiples" so that individuals could work on a
> > particular section without affecting others.  It seems
> > there is also the camp that would rather just have the
> > servlet read multiple config files.  I am indifferent
> > (at this point) to which solution i think should be
> > adopted, but think that Struts could certainly be more
> > "team development" friendly by choosing one and then
> > offering it.  I have some extra bandwith and would
> > like to get involved in the "core" struts development.
> >  Craig/Ted/Others, I'd be happy to develop one or
> > both.  I guess I'd like to know what people want to
> > see developed and what has the highest likelyhood of
> > being incorporated into Struts and I will develop it.
> >
> > What about the whole debate on multiple ActionServlets
> > per WAR?  If I were to "solve" this would this be
> > something that could go into the core?
> >
> > -james
> > jholmes612@yahoo.com
> > http://www.ejcenter.com/struts/
> >
> >
> > --- Ted Husted <hu...@apache.org> wrote:
> > > Can we join this with the idea of having multiple
> > > Struts configuration
> > > files, or, on a related front, multiple workflow
> > > configuration files?
> > >
> > > martin.cooper@tumbleweed.com wrote:
> > > >
> > > > The Struts 1.1 TODO list contains the following
> > > item:
> > > >
> > > > "XmlMessageResources. Implementation of
> > > MessageResources and
> > > > MessageResourcesFactory that loads message keys
> > > and strings from one or more
> > > > XML resources or files."
> > > >
> > > > I have an implementation of this which I would
> > > like to contribute to Struts.
> > > > The implementation is a drop-in replacement for
> > > the existing
> > > > PropertyMessageResources. In fact, it is derived
> > > from it, and so shares the
> > > > same file naming scheme for locale-specific
> > > messages.
> > >
> > > "SCHACHTER,MICHAEL (HP-NewJersey,ex2)" wrote:
> > > >
> > > > Martin,
> > > >
> > > > In the jakarta-commons-sandbox, there's a folder
> > > > called "resources" containing Struts
> > > MessageResources
> > > > and some other classes that I was working on, but
> > > had
> > > > to put off for a while.
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Make a great connection at Yahoo! Personals.
> > http://personals.yahoo.com

Re: [PROPOSAL] XMLMessageResources

Posted by ma...@tumbleweed.com.
Personally, I am firmly in the second camp (reading multiple config files).
My reasoning is as follows.

I am working on a large project that will result in a common framework, and
product modules which plug in to that framework. The common framework, and
all of the product modules, will use Struts. Product modules can be
installed and uninstalled by our customers.

Using some kind of 'include' mechanism solves the problem of different
product teams stepping on each others' toes when editing the Struts
configuration. However, it makes installation and uninstallation somewhat
harder, because those applications will have to understand the structure of
the Struts configuration file.

Using multiple configuration files allows me to have one config file for the
common framework, and then one more for each product. Each product team can
concentrate on its own config file, and the installer and uninstaller only
have to worry about which files to add or remove, and not about what they
contain or how to modify them.

--
Martin Cooper


----- Original Message -----
From: "James Holmes" <jh...@yahoo.com>
To: <st...@jakarta.apache.org>
Sent: Saturday, October 13, 2001 4:29 PM
Subject: Re: [PROPOSAL] XMLMessageResources


> It seems there has been some discussion in the past
> about a new config file DTD that would support having
> "multiples" so that individuals could work on a
> particular section without affecting others.  It seems
> there is also the camp that would rather just have the
> servlet read multiple config files.  I am indifferent
> (at this point) to which solution i think should be
> adopted, but think that Struts could certainly be more
> "team development" friendly by choosing one and then
> offering it.  I have some extra bandwith and would
> like to get involved in the "core" struts development.
>  Craig/Ted/Others, I'd be happy to develop one or
> both.  I guess I'd like to know what people want to
> see developed and what has the highest likelyhood of
> being incorporated into Struts and I will develop it.
>
> What about the whole debate on multiple ActionServlets
> per WAR?  If I were to "solve" this would this be
> something that could go into the core?
>
> -james
> jholmes612@yahoo.com
> http://www.ejcenter.com/struts/
>
>
> --- Ted Husted <hu...@apache.org> wrote:
> > Can we join this with the idea of having multiple
> > Struts configuration
> > files, or, on a related front, multiple workflow
> > configuration files?
> >
> > martin.cooper@tumbleweed.com wrote:
> > >
> > > The Struts 1.1 TODO list contains the following
> > item:
> > >
> > > "XmlMessageResources. Implementation of
> > MessageResources and
> > > MessageResourcesFactory that loads message keys
> > and strings from one or more
> > > XML resources or files."
> > >
> > > I have an implementation of this which I would
> > like to contribute to Struts.
> > > The implementation is a drop-in replacement for
> > the existing
> > > PropertyMessageResources. In fact, it is derived
> > from it, and so shares the
> > > same file naming scheme for locale-specific
> > messages.
> >
> > "SCHACHTER,MICHAEL (HP-NewJersey,ex2)" wrote:
> > >
> > > Martin,
> > >
> > > In the jakarta-commons-sandbox, there's a folder
> > > called "resources" containing Struts
> > MessageResources
> > > and some other classes that I was working on, but
> > had
> > > to put off for a while.
>
>
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com



Re: [PROPOSAL] XMLMessageResources

Posted by James Holmes <jh...@yahoo.com>.
It seems there has been some discussion in the past
about a new config file DTD that would support having
"multiples" so that individuals could work on a
particular section without affecting others.  It seems
there is also the camp that would rather just have the
servlet read multiple config files.  I am indifferent
(at this point) to which solution i think should be
adopted, but think that Struts could certainly be more
"team development" friendly by choosing one and then
offering it.  I have some extra bandwith and would
like to get involved in the "core" struts development.
 Craig/Ted/Others, I'd be happy to develop one or
both.  I guess I'd like to know what people want to
see developed and what has the highest likelyhood of
being incorporated into Struts and I will develop it.

What about the whole debate on multiple ActionServlets
per WAR?  If I were to "solve" this would this be
something that could go into the core?

-james
jholmes612@yahoo.com
http://www.ejcenter.com/struts/


--- Ted Husted <hu...@apache.org> wrote:
> Can we join this with the idea of having multiple
> Struts configuration
> files, or, on a related front, multiple workflow
> configuration files?
> 
> martin.cooper@tumbleweed.com wrote:
> > 
> > The Struts 1.1 TODO list contains the following
> item:
> > 
> > "XmlMessageResources. Implementation of
> MessageResources and
> > MessageResourcesFactory that loads message keys
> and strings from one or more
> > XML resources or files."
> > 
> > I have an implementation of this which I would
> like to contribute to Struts.
> > The implementation is a drop-in replacement for
> the existing
> > PropertyMessageResources. In fact, it is derived
> from it, and so shares the
> > same file naming scheme for locale-specific
> messages.
> 
> "SCHACHTER,MICHAEL (HP-NewJersey,ex2)" wrote:
> > 
> > Martin,
> > 
> > In the jakarta-commons-sandbox, there's a folder
> > called "resources" containing Struts
> MessageResources
> > and some other classes that I was working on, but
> had
> > to put off for a while.


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

Re: [PROPOSAL] XMLMessageResources

Posted by Ted Husted <hu...@apache.org>.
Can we join this with the idea of having multiple Struts configuration
files, or, on a related front, multiple workflow configuration files?

martin.cooper@tumbleweed.com wrote:
> 
> The Struts 1.1 TODO list contains the following item:
> 
> "XmlMessageResources. Implementation of MessageResources and
> MessageResourcesFactory that loads message keys and strings from one or more
> XML resources or files."
> 
> I have an implementation of this which I would like to contribute to Struts.
> The implementation is a drop-in replacement for the existing
> PropertyMessageResources. In fact, it is derived from it, and so shares the
> same file naming scheme for locale-specific messages.

"SCHACHTER,MICHAEL (HP-NewJersey,ex2)" wrote:
> 
> Martin,
> 
> In the jakarta-commons-sandbox, there's a folder
> called "resources" containing Struts MessageResources
> and some other classes that I was working on, but had
> to put off for a while.

Re: [PROPOSAL] XMLMessageResources

Posted by James Holmes <jh...@yahoo.com>.
Looks good.  In fact I myself had an interest in
writing just this functionality and have just been too
busy with the Console to take on any "Core"
development work.

-james


--- martin.cooper@tumbleweed.com wrote:
> The Struts 1.1 TODO list contains the following
> item:
> 
> "XmlMessageResources. Implementation of
> MessageResources and
> MessageResourcesFactory that loads message keys and
> strings from one or more
> XML resources or files."
> 
> I have an implementation of this which I would like
> to contribute to Struts.
> The implementation is a drop-in replacement for the
> existing
> PropertyMessageResources. In fact, it is derived
> from it, and so shares the
> same file naming scheme for locale-specific
> messages.
> 
> Here's a simple example of what an XML message file
> would look like:
> 
> ---------- begin example ----------
> <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> <messages>
>   <message key="validation.username.required">You
> must enter a
> username</message>
>   <message key="validation.password.required">You
> must enter a
> password</message>
>   <message
> key="validation.password.match">Confirmation
> password does not
> match</message>
> </messages>
> ---------- end example ----------
> 
> The first line of the example provides a hint as to
> why I did not attempt to
> incorporate messages for more than one locale into a
> single XML file.
> Messages for different locales may well be specified
> using different
> character encodings. In addition, maintaining the
> messages from each locale
> in a different XML file avoids loading locales
> unnecessarily.
> 
> To use this implementation, all that is required is
> to specify the 'factory'
> init-param in your web.xml file, and to make sure
> that the 'application'
> init-param refers to an XML resource.
> 
> What do people think about incorporating this into
> the Struts 1.1 code base?
> 
> --
> Martin Cooper
> 
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com