We help IT Professionals succeed at work.

how to check if Map is empty or not

Newton21205
Newton21205 asked
on
i have a res object which has resultMap. i want a code to check if the resultMap is empty if so then display warning message.

<c:if test='${res.resultMap[0] == "null" && res.resultMap == "null"}'><br/>
      <b class="TextWarningText">No Result Found</b>
</c:if>

this does not work
Comment
Watch Question

Commented:
><c:if test='${res.resultMap[0] == "null" && res.resultMap == "null"}'><br/>  
you could try using  
<c:if test='${empty res.resultMap}'><br/>
But for your way, you should have tried  
<c:if test='${res.resultMap[0] == null && res.resultMap == null}'><br/>
or maybe you want
<c:if test='${res.resultMap[0] == null || res.resultMap == null}'><br/>