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

Usage of ${ }

 
Aniket Patil
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 ]
 
neetika sharma
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:-)
 
Sayak Banerjee
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?
 
Kevin DesLauriers
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic