2

I am trying to use an if condition to display an item or not in one of my JSP files.

I currently have

<c:if test="${fn:length(${model.listOfListProducts}) gt 0}">
<p> we got in </p>
</c:if>

I am trying to see if the length of one of my Lists< List<>> in my model object is essentially greater than 0 (not null)

But this does not display the paragraph that I have placed inside. Is my test statement syntactically wrong?

jmj
  • 237,923
  • 42
  • 401
  • 438
user3777012
  • 93
  • 1
  • 2
  • 8

1 Answers1

2

remove $ from nested expression

<c:if test="${fn:length(model.listOfListProducts) gt 0}">
  <p> we got in </p>
</c:if>

See Also

Community
  • 1
  • 1
jmj
  • 237,923
  • 42
  • 401
  • 438