It's not a secret anymore!
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 Head First Android 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: 63052
    
  69

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: 63052
    
  69

Be sure to declare the fn namespace on your page.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSTL size of collection
 
It's not a secret anymore!