• Post Reply Bookmark Topic Watch Topic
  • New Topic

MessageBoundle list  RSS feed

 
Johan Rignas
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I see in examples that the MessageBoundles are often lists/arrays. How do I make those lists?

This is how my structure looks:

template.jsf(init):


LocaleBean:


Now I can use .properties files like this: #{bundle.var}
But how do I make lists like this: #{msgs['page.cat.name']}?
 
Tim Holloway
Bartender
Posts: 18716
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My memory is not good here, but as far as I can remember, while a bundle component itself can be a collection, it cannot contain collections.

Specifically, it implements the Properties architecture, which is a collection of key/value pairs, where both key and value are strings. So for case where someone wants a "collection", the trick is to make it part of the key:



EL is not intended to be a general-purpose programming language. For one thing, putting heavyweight program code on the View violates the fundamental purpose of the Model/View/Controller architecture, which is separation of concerns. So it's probably going to be easier to synthesize this sort of property name (and retrieve its value) in a backing bean.
 
Johan Rignas
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. Sounds like there is not the standard way to make a list-thing with the boundles. Keep on with my all random in one property file
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!