I agree, looks like a usuable feature... :: Mikkel Bruun Senior IT Developer [EMAIL PROTECTED] Direct: +45 32 88 22 73
Valtech A/S Kanonbaadsvej 10 DK-1437 Copenhagen Tel +45 32 88 20 00 Fax +45 32 88 20 20 > -----Oprindelig meddelelse----- > Fra: James Holmes [mailto:[EMAIL PROTECTED]] > Sendt: 11 October 2001 12:47 > Til: [EMAIL PROTECTED] > Emne: Re: [PROPOSAL] XMLMessageResources > > > 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 > > > --- [EMAIL PROTECTED] 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 >