• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

i18n and values for a select - how to store and ensure display order?

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am developing a JSP, which needs to support localisation and need to have a select list display values in a specific order. I had looked into using ResourceBundle, since that allows me to find the file according to the locale supplied by the user, but I am unable to use it as a parameter for a JSTL select. I then looked at using a properties file, but the order of the entries in the file is ignored.

I imagine I am not the first person to have this need, so I would be curious what solution there is? Something already in the API, a third-party library or something else?

Edit: Note I am using this in conjunction with Struts2 and JDK 1.5, if that makes a difference.
 
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi There..,

The locale parameter is not an attribute which you might be able to pass into a JSTL tag, and that is true.
But since you are using Struts here, you might want to try it using <html:select> and <html:options> which would take in
the locale information also [optional parameter], and hence could come to your help. In short, try replacing your JSTL tags
for localization, with the struts HTML tags.

Dawn.
 
Ranch Hand
Posts: 1211
Mac IntelliJ IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What Dawn said... Use Struts 2 select tag.
 
Dawn Charangat
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, did you try it ?
reply
    Bookmark Topic Watch Topic
  • New Topic