File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 60063
    
  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: 60063
    
  65

Be sure to declare the fn namespace on your page.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JSTL size of collection
 
Similar Threads
how to iterate.
how to populate formbean property using html:checkbox values
found String rquired int
Problem with nested c:forEach
JSTL paging problem