Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can we put el expression value in single quotes

 
Jyoti Vaskar
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have tested the above code & its working.

How its working as I have given the value(not attribute) in single quotes?
Kidly explain.
 
Punit Singh
Ranch Hand
Posts: 952
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you are right you have given value means you have given String object. And EL can print String's value.
Try some mathematical operations also.
 
Ankit Garg
Sheriff
Posts: 9580
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Punit said, EL is not only for scoped attributes. If you write ${1101} then 1101 will be displayed, if you write ${100/10} then 10 will be displayed. If you write ${"whatever"} or ${'whatever'}, whatever will be displayed. If you write [tt]${"what"+"ever"}, you'll get an exception (there's no string concatenation in EL)...
 
Jyoti Vaskar
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you Punit & Ankit for your good answers.

It's really had been very helpful .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic