• 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

Expression Language jspx

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I've read some topics about El and complex expressions but i have not get a solution yet.

I'm trying to get a value of a messages.properties file in a jspx and it works fine with any of this EL expressions:
"#{TWF_MESSAGES.messages['comun.pruebas']}" // a literal
"#{TWF_MESSAGES.messages[bean.name]}" // a bean attribute

The problem is that I've tried to concat them like:

"#{TWF_MESSAGES.messages['comun.pruebas' bean.name]}"

or

value='${TWF_MESSAGES.messages["menu.funcional.check. + bean.name]}'

without success (i've tried more combinations but I can't mix both conditions...)

I know that it can be done in the bean, but i want to get it in the jspx.

Any idea?
Thanks in advance!
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
More like:


However, as a general rule, complex EL isn't recommended. It makes maintenance more difficult, tends to be hard to read - and to develop, and you don't get the benefits of compile-time checking that you do when using Java backing beans.

So a preferable way to do what you want is more like


and put the message logic in the "getNameMessage()" method of "myBean.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic