title: Struts2, JSP, Test String for null and Empty in iteration
body: <p>I am using Struts2. And having trouble in test a String for null or empty. The String is in a loop.</p>
  
  <p>What I have done so far is</p>
  
  <p>in Action class I have a <code>List&lt;User&gt;</code>. <code>User</code> have <code>id</code> and <code>name</code> fields and have getters and setters...</p>
  
  <p>in JSP i am doing like</p>
  
  <pre><code>&lt;s:iterator value="userList" var="user" status="userStatus"&gt;
      &lt;s:if test"%{user.name != null &amp;&amp; user.name != ''}"&gt;
         ${user.name}
         &lt;!-- Do some thing... --&gt;
      &lt;/s:if&gt;
  &lt;/s:iterator&gt;
  </code></pre>
  
  <p>Problem is that Its not working :(, I cannot see the names and they are visible if I remove the <code>&lt;s:if&gt;</code> block.</p>