• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 242
  • Last Modified:

putList Empty

If i have a tiles definition in a struts based application and i want to tets it to see if the list is empty how can this be done?

I assume an IF statemnet is the easyest way to do this test.

<c:if test="**somthing** != ' ' ">

the putList name is contentCenterList
0
willa666
Asked:
willa666
1 Solution
 
bloodredsunCommented:
Try the "empty" keyword. It will work for Lists (although not Sets)

<c:if test='${empty myList}'>
...
</c:if>
0
 
willa666Author Commented:
hey BRS

i was going to settle for this:
      <c:when test="${myList != null} -- ${myList != null}">

But the empty keyword works for me! :)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now