title: JSTL - Cast Error String to Long
body: <p>I'm trying to compare to value using <code>JSTL</code> but I'm bumping this error.</p>
  
  <blockquote>
    <p>An error occurred while evaluating custom action attribute "value"
    with value "${item.ruleValues.size}": The "." operator was supplied
    with an index value of type "java.lang.String" to be applied to a List
    or array, but that value cannot be converted to an integer. (null)</p>
  </blockquote>
  
  <p>This are the specific code line -  </p>
  
  <pre><code>&lt;c:set var="nElCol" value="0" scope="page"/&gt;
  &lt;c:forEach var="elem" items="${item.ruleValues}" varStatus="status"&gt;
      &lt;c:set var="size" value="${item.ruleValues.size}" scope="page" /&gt;
      &lt;c:set var="nElCol" value="${nElCol + 1}" scope="page"/&gt;
  
      &lt;c:if test="${size == (nElCol-1)}"&gt;
          &lt;TD align="center" width="110"&gt;
              &lt;input id='&lt;c:out value="${count}" /&gt;' type="text" name="fname" value='&lt;c:out value="${elem}"/&gt;'&gt; 
          &lt;/TD&gt;   
          &lt;TD align="center" width="110"&gt;
              &lt;img src="/XA-IME-PF/public/img/Plus.jpg" alt="add" width="10" height="10"/&gt;
          &lt;/TD&gt;
      &lt;/c:if&gt; 
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>The <code>item</code> object is this one:</p>
  
  <pre><code>public class BoElementToPrint implements Serializable{
  
      private List ruleValues; 
  
      /**
       * @return
       */
      public List getRuleValues() {
          return ruleValues;
      }
  
      /**
       * @param list
       */
      public void setRuleValues(List list) {
          ruleValues = list;
      }
  }
  </code></pre>
  
  <p><code>ruleValues</code> is a List of String.</p>