Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL question

 
Abhishek Sharma
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

Here is one question on JSTL core tags.




As per my observation it should be 2, 3.


Please correct me if i am wrong.
 
Manju Devarla
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To avoid scripting,declaration and expressions only we are going for custom tags..
 
madhav changala
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My answer is 1,2

As only Simple tags only doesn't accept scripting.. before simple tags. i.e classic tags are accepting scriptlets and expression etc..

Could any one confirm this..


Thanks®ards
Madhav
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes..

simple tags dont accept scripting !
 
Abhishek Sharma
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well...ok, are you sure about Strings also (as specified in option one) and what do you say about option 3, can't we use "varStatus" inside the body of iteration tag. ???
 
Anupama Ponnapalli
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<table border=1 cellspacing=0 cellpadding=3>
<tr bgcolor="#CCFFFF">
<td><B>Loop Counter</B></td>
<td><B>Token</B></td>
</tr>
<c:forEach var="token" items="abc,def,ghi,jkl,mno,pqr,stu,vxyz" varStatus="statusKeeper" >
<tr>
<td>${statusKeeper.count}</td>
<td>${token} </td>
</tr>
</c:forEach>
</table>

works!
 
warren li
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My take is on 1 and 3. varStatus certainly can be used in the body, so 3 is correct.

Regarding 2, are you sure scripting is not allowed in JSTL core tags?
I don't remember it is mentioned somewhere.
[ March 12, 2007: Message edited by: warren li ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic