0

I have a bean with a status field which can take one of three predefined values: ACTIVE, BLOCKED, DELETED. For each of those, I defined a label in a properties file:

entity.status.ACTIVE=Active
entity.status.BLOCKED=Blocked
entity.status.DELETED=Deleted

Is there any way of displaying the entity's status' label? More exactly, is there a way of combining the static 'entity.status.' string with the dynamic status value to get a key for a resource bundle? I saw this question, but it doesn't answer my needs completely

Thanks.

Community
  • 1
  • 1
Mihai Tudor
  • 422
  • 4
  • 15

1 Answers1

0

You can use the concat function like this:

#{myResourceBundle['entity.statut.'.concat(myBean.status)]}
Simon Arsenault
  • 1,777
  • 17
  • 35