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
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:
Tim Cooke
Campbell Ritchie
paul wheaton
Jeanne Boyarsky
Ron McLeod
Sheriffs:
Paul Clapham
Devaka Cooray
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
Struts
struts2 question
Raj Bhandari
Ranch Hand
Posts: 97
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi all,
I want to find out the size of a results list so I can display correct message.
In
Struts
1.x, I'd do this:
<bean:size id="size" name="xyzForm" property="resultList"/> <logic:equal name="size" value="0"> <center><FONT color="red"><b>No Results Found</b></FONT></center> </logic:equal> <logic:greaterThan name="size" value="0"> //begin iteration </logic:greaterThan>
But how do I do the same using Struts2 ? Is there a way now without JSTL tags for this?
Tks :-)
Merrill Higginson
Ranch Hand
Posts: 4864
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I'd suggest just using JSTL:
<c:choose> <c:when test="${empty resultList}" > <!-- do something --> </c:when><c:otherwise> <!-- do something else --> </c:otherwise> </c:choose>
[ May 28, 2008: Message edited by: Merrill Higginson ]
Merrill
Consultant,
Sima Solutions
Raj Bhandari
Ranch Hand
Posts: 97
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Tks Merrill, I knew one option is jstl or we could do this:
<s:if test="%{resultList!=null}"> Search Results: <br><br> <s:if test="%{resultList.isEmpty}"> No results found </s:if> <s:else> //iterate thro's list </s:else> </s:if>
Hopefully, it helps someone..
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
html:text within Logic:iterate
HTML:OPTIONS
tag nesting error?
Missing message for key
change 'action' path dynamically inside JSP.
More...