• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF Expression Language (EL without tags)

 
seb petterson
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does JSF provide expression language that can be used outside of tags? like JSTL's ? (I've only been able to do it like: )

Thanks in advance,

Seb
[ July 20, 2005: Message edited by: seb petterson ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Why would you need to do that?
 
seb petterson
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:
No. Why would you need to do that?

Less to write, and more readable code. Think internationalized page with a a few of dussins of labels where a variable "language" is loaded from a properties file, I would then appreciate if i could limit the code to "#{language.LBL_myLable}"
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by seb petterson:

Less to write, and more readable code. Think internationalized page with a a few of dussins of labels where a variable "language" is loaded from a properties file, I would then appreciate if i could limit the code to "#{language.LBL_myLable}"


Try exploring f:loadBundle tag. You can easily read labels from properties file.
 
seb petterson
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Varun Khanna:


Try exploring f:loadBundle tag. You can easily read labels from properties file.

That is what I've done. First I have:

Where language_gb is a properties file
Then I get the localized text with:

Do you mean there's an easier way? (Not that this is hard, I'm just looking to minimize the amount of code)

/Seb
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No Seb, that is how it is done. It doesn't get much easier. The reason you use the tags in the JSP for JSF is because it has to be rendered as part of the UIViewRoot. If you just put in EL as ${bean.property} JSF would no nothing about it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!