title: How to know if List is empty or not in Struts2?
body: <p>I have one List. Which is fetch from java class to jsp page. I want to display this List in jsp page but, if List is empty then display one error message otherwise display List's item.</p>
  
  <pre><code>&lt;s:iterator value="productList"&gt;
      &lt;tr style="background-color: #99CCFF"&gt;      
          &lt;td&gt;&lt;s:property value="pid"/&gt;&lt;/td&gt;
          &lt;td&gt;&lt;s:property value="productname"/&gt;&lt;/td&gt;
          &lt;td&gt;&lt;s:property value="producttype"/&gt;&lt;/td&gt;
          &lt;td&gt;&lt;s:property value="productprice"/&gt;&lt;/td&gt;
          &lt;td&gt;&lt;s:property value="shopname"/&gt;&lt;/td&gt;
          &lt;td&gt;&lt;s:property value="productcity"/&gt;&lt;/td&gt;
          &lt;td&gt;&lt;s:property alue="ownername"/&gt;&lt;/td&gt;                 
      &lt;/tr&gt;
  &lt;/s:iterator&gt;   
  </code></pre>