Search code examples
springjstljstl-functions

Check multiple list sizes in JSTL


How do I chain multple length checks?

I tried these ways to no effect:

<c:if test="${fn:length(app.applicationAdminComments) le 0  or fn:length(app.applicationChoComments) le 0  }"> 

and

<c:if test="${(fn:length(app.applicationAdminComments) le 0)  || (fn:length(app.applicationChoComments) le 0 )}">

but neither is working.


Solution

  • If you don't get an error, the possible causes are:

    • app.applicationAdminComments is null
    • app.applicationChoComments is null
    • length of app.applicationAdminComments is 0
    • length of app.applicationChoComments is 0