Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
André-John Mas
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • 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.
 
Dawn Charangat
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
  • 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 <htmlptions> 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.
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Yes, did you try it ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic