Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help on Taglib : jstl/c

 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,



i though the above code prints one, two and three..
why is it ?

Thanks,
Rajeev
 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i had to use tomcat 5..

Rajeev.
 
Sunny Singh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rajvee, Here's the right way to get items from request scope.

<C:forEach var="movie" items="${requestScope.movieRequest}">
<TR><TD width="146">${movie}</TD> </TR>
</C:forEach>
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Either of ${requestScope.movieRequest} or ${movieRequest} will work since the latter searches all scopes to find the variable. The difference is that the first will only look in request scope.

The shorter version will fail only if a conflicting variable named movieRequest also exists in page scope.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic