title: <c:if test='${not empty "${records}"}'> never evaluates false
body: <p>I am having a problem with JSTL and empty operator. I already made few simple pages and everything worked fine, but now I have:</p>
  
  <pre><code>    &lt;%@ page language="java" contentType="text/html; charset=UTF-8"
          pageEncoding="UTF-8"%&gt;
      &lt;%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%&gt;
      &lt;html&gt;
      &lt;body&gt;
  
       &lt;form action="/Projekt/myaccount" method="post"&gt;
      &lt;table border="1"&gt;
          &lt;tr&gt;
                   &lt;td&gt;Artist&lt;/td&gt;
                   &lt;td&gt;Record Name&lt;/td&gt;
                   &lt;td&gt;Delete&lt;/td&gt;
           &lt;/tr&gt;
          &lt;c:forEach var="item" items="${records}"&gt;
           &lt;tr&gt;
                   &lt;td&gt;${item.artist}&lt;/td&gt;
                   &lt;td&gt;${item.recordName}&lt;/td&gt;
                   &lt;td&gt;
                      &lt;input type="checkbox" name='${item.recordName}|${item.recordName}'/&gt;
                   &lt;/td&gt;
           &lt;/tr&gt;
          &lt;/c:forEach&gt;
      &lt;/table&gt;
      &lt;hr/&gt;
          &lt;input type="submit" name="back" value="back"/&gt;
          &lt;c:if test='${not empty "${records}"}'&gt;
                 &lt;input type="submit" name="delete" value="delete selected"/&gt;
          &lt;/c:if&gt;
       &lt;/form&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>now no matter if I set the records attribute or not, the delete button shows up:</p>
  
  <pre><code>&lt;c:if test='${not empty "${records}"}'&gt;
             &lt;input type="submit" name="delete" value="delete selected"/&gt;
      &lt;/c:if&gt;
  </code></pre>
  
  <p>in normal situation to records attribute I pass ArrayList and then use foreach, but sometimes ArrayList is empty, so in those situations I don't want delete button to show up, I fought that easiest way to achieve this would be to use this empty operator. Where am I making a mistake?</p>
  
  <p>I even tried to manually set this attribute to null:</p>
  
  <pre><code>if (ar.size() != 0)
      request.setAttribute("records", ar);
  else
      request.setAttribute("records",null);
  </code></pre>
  
  <p>EDIT:
  @Qwe: yes you are right, it worked for me before because I tested if attribute was empty in my way, it was always true, because I used wrong construct, but it worked because I just wanted to show one string, if there was no String nothing showed up so I was thinking that everything worked fine.</p>