This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes JSTL size of collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL size of collection" Watch "JSTL size of collection" New topic
Author

JSTL size of collection

Tom Henricksen
Ranch Hand

Joined: Mar 23, 2004
Posts: 136

Is there a way to get the size of a collection?



This seems quite common and I have seen some old questions on it that say we must use a scriptlet to do this.
Thanks,
Tom
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60789
    
  65

What version of JSP are you using and what version of the JSTL? This is always important info to include with these types of questions.

If your answer is JSP 2.0/JSTL 1.1, then you can use the JSTL fn:length function:


[ December 12, 2005: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Tom Henricksen
Ranch Hand

Joined: Mar 23, 2004
Posts: 136

Thanks Bear I will give that a try.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60789
    
  65

Be sure to declare the fn namespace on your page.
 
 
subject: JSTL size of collection
 
Similar Threads
Problem with nested c:forEach
how to populate formbean property using html:checkbox values
JSTL paging problem
how to iterate.
found String rquired int