Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Eclipse Collections Categorically: Level up your programming game
this week in the
Open Source Projects
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Ron McLeod
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Struts
getting size of a collection object in struts
akshaj nampelly
Greenhorn
Posts: 18
posted 20 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi
I have a search criteria in my application, I need to display the size of the search results on resutls
jsp
, I have done it by declaring attribute like searchresultssize in searchForm, But I feel it is redundant,
Is there any otherway of doing it?
Tx
Akshaj
Merrill Higginson
Ranch Hand
Posts: 4864
posted 20 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
There's no
struts
tag that I'm aware of that will give you the size of a collection, but you can do it easily with a scriptlet:
<%=myCollection.size()%>
Merrill
Consultant,
Sima Solutions
Marc Peabody
pie sneak
Posts: 4727
I like...
posted 20 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You can have a getter in your ActionForm without a variable behind it. You don't need the redundancy of creating the variable.
A getter method in the ActionForm could simply return yourCollection.size();
Merrill's scriptlet is also a good solution.
A good workman is known by his tools.
Yes, my master! Here is the tiny ad you asked for:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Applying AVL algorithm to an unbalanced binary search tree
How can I customised the Ok-Cancel Button in JOptionPane
Button Size
Deploy ear file in WAS using ANT
Can I get code for 'CTRL F'
More...