Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Usage of ${ }  RSS feed

 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not yet clear about when a variable needs to be wrapped with ${ }. For instance, the c:forEach is as follows:

<c:forEach var = "someVar" items = "${collection}" />

Why does "collection" need to be wrapped with ${ }, why not just a items = "collection". How does a "${collection}" differ from "collection"? More importantly, when is the ${ } needed?
[ January 29, 2007: Message edited by: Aniket Patil ]
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to me... something inside{} means evaluate the particular thing.Basically {} refers to evaluate... Taking your example...


Originally posted by Aniket Patil:
[QB]I'm not yet clear about when a variable needs to be wrapped with ${ }. For instance, the c:forEach is as follows:

<c:forEach var = "someVar" items = "${collection}" />

QB]



iteration will be done over the value of the collection, {collection} and then result of each iteration is stored in "somevar", so that you can acess a particular element of the bean(stored in somevar). kindly corect me , if i m wrong:-)
 
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CHECK THIS
 
Aniket Patil
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Enlightening...

BTW i read-up the description of <c:catch var> in JSTL, and it is as below:

From dynamic, i assume an EL Expression is not possible. The table mentions
Type as String but also says the type is of the exception thrown. What does the Type column mean?
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do belileve that it means that it must be a String literal and not EL, scripting or an action.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!