• 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

Why $ in jstl core tag attributes?

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the jstl core tag attributes why do we have it like

<c:choose>
<c:when test="${customer.category == 'trial'}" >

This syntax "${customer.category == 'trial'}" is very non intuitive and confusing to me. After all this entire string is going to be fed to the java implementation which is going to extract out the operands. It could have been allowed like <c:when test="customer.category == 'trial'" >

Is there any logical reason with the $ and {} ; I forget the weird syntax everytime.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

After all this entire string is going to be fed to the java implementation which is going to extract out the operands. It could have been allowed like <c:when test="customer.category == 'trial'" >



The EL syntax '${}' tells the tag that you're not passing it it a string.
You're passing it an expression which needs to be evaluated.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And as of JSP 2.0, it has nothing to do with the JSTL. The EL is party of core JSP.
reply
    Bookmark Topic Watch Topic
  • New Topic