Hi, Bryan,
I could not agree more. But, you might as well bang your head against
the wall as play Cassandra to this version of the Trojan Horse (JSF).
What I do in these cases is to just extend the tags. This one is
fairly easy. Here is a sample early method I built off of which you
can modify with extensions of the Struts tags to suit your taste:
public List getLocalizedLabelValueList(HttpServletRequest request,
List keys)
throws IOException,
ServletException {
List labelValueList = Collections.synchronizedList(new
LinkedList());
HttpSession session = request.getSession();
Locale locale =
(Locale)session.getAttribute(Globals.LOCALE_KEY);
Iterator iterator = keys.iterator();
MessageResources messages = this.getResources(request);
while(iterator.hasNext()) {
String value = ((String)iterator.next());
String label = convertToUTF8(messages.getMessage(locale,value));
labelValueList.add(new LabelValueBean(label,value));
}
return labelValueList;
}
Jack
On Wed, 15 Dec 2004 10:59:37 +0100, bryan <[EMAIL PROTECTED]> wrote:
> If I were to speculate which would be more usefull to the community,
> implementing something basic like this or creating support for JSF I
> would imagine that this would
> probably be more useful.
>
> This reminds me of my skateboarding days, before learning how to do a
> 360 fakie kickflip it's kinda usefull to learn how to do an ollie ....
>
> Thanks Niall.
>
> --b
>
> On Wed, 15 Dec 2004 00:24:11 -0000, Niall Pemberton
> <[EMAIL PROTECTED]> wrote:
> > It has come up before:
> >
> > http://issues.apache.org/bugzilla/show_bug.cgi?id=9748
> > http://issues.apache.org/bugzilla/show_bug.cgi?id=17600
> >
> > but it hasn't been implemented in Struts
> >
> > Niall
> >
> > ----- Original Message -----
> > From: "bryan" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, December 14, 2004 8:10 PM
> > Subject: Localize a dropdown select list
> >
> > > Is this possible with struts ? i don't find a mention of it but can't
> > > imagine it hasn't been implemented.
> > >
> > > For example in the jsp
> > >
> > > <html-el:select property="swimmingPool">
> > > <html-el:optionsCollection property="swimmingPoolOptions"
> > > value="name" label="name"/>
> > > </html-el:select>
> > >
> > > Which generates the following ...
> > > <select name="swimmingPool"><option value="type.yes">type.yes</option>
> > > <option value="type.no">type.no</option>
> > > <option value="type.option_to_build">type.option_to_build</option>
> > > <option value="type.undefined">type.undefined</option></select>
> > >
> > > Is it possible to map type.no to a value in the resource bundles ??
> > >
> > > --b
> > >
> > > --
> > > http://www.revoltingdigits.com
> > > https://jestate.dev.java.net
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> --
> http://www.revoltingdigits.com
> https://jestate.dev.java.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~
"You can't wake a person who is pretending to be asleep."
~Native Proverb~
"Each man is good in His sight. It is not necessary for eagles to be crows."
~Hunkesni (Sitting Bull), Hunkpapa Sioux~
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]