| From | Sent On | Attachments |
|---|---|---|
| Steven D. Wilkinson | Jan 29, 2001 7:21 am | |
| Michael Mok | Jan 29, 2001 7:57 am | |
| Chris Smith | Jan 29, 2001 8:26 am | |
| Frederic BAGES | Jan 29, 2001 8:59 am | |
| Steven D. Wilkinson | Jan 29, 2001 9:37 am | |
| Frederic BAGES | Jan 29, 2001 9:48 am | |
| Steven D. Wilkinson | Jan 29, 2001 10:14 am | |
| Justin Kennedy | Jan 29, 2001 10:18 am | |
| Frederic BAGES | Jan 29, 2001 10:18 am | |
| Craig R. McClanahan | Jan 31, 2001 2:08 pm |
| Subject: | i18n | |
|---|---|---|
| From: | Steven D. Wilkinson (stev...@acm.org) | |
| Date: | Jan 29, 2001 7:21:41 am | |
| List: | org.apache.struts.user | |
I'm generating drop downs for use in my JSP pages. These drop downs are being created as follows: I have a Servlet that starts up after the ActionSerlvet. In it's init() I do the following: messages = (MessageResources) servletContext.getAttribute(Action.MESSAGES_KEY);
Then later I build my ArrayList of CreditCardTypes.
public void setCreditCardTypes() { ArrayList ccTypes = new ArrayList(5); ccTypes.add( new OptionLabelValue(messages.getMessage("title.option.selectOne"), messages.getMessage("option.unknown")) );
String i8nLabelValue = messages.getMessage("cc.option.visa"); ccTypes.add(new OptionLabelValue(i8nLabelValue,i8nLabelValue));
i8nLabelValue = messages.getMessage("cc.option.mc"); ccTypes.add(new OptionLabelValue(i8nLabelValue,i8nLabelValue));
i8nLabelValue = messages.getMessage("cc.option.amex"); ccTypes.add(new OptionLabelValue(i8nLabelValue,i8nLabelValue));
i8nLabelValue = messages.getMessage("cc.option.discover"); ccTypes.add(new OptionLabelValue(i8nLabelValue,i8nLabelValue));
servletContext.setAttribute(Constants.CCTYPES_ARRAY_KEY, ccTypes); } //end setCreditCardTypes
Since I'm setting this in the servletContext as an application parameter would I need to create all the drop downs for the languages that my application supported then use the getMessage(Locale, Key)? I guess then I should consider a HashMap with the Locale as the key to access the array.... Does that sound like the proper approach?
Thanks in advance,
Steve





