title: Call methods in Expression Language
body: <p>How can I invoke a method in JSP using EL (<a href="https://en.wikipedia.org/wiki/Unified_Expression_Language" rel="noreferrer"><em>Expression Language</em></a>)?</p>
  
  <p>For example:</p>
  
  <pre><code>&lt;c:forEach var="item" items="${listStr}" begin="0" end="2" step="2"&gt;
      &lt;p&gt;${item.indexOf("h")}&lt;/p&gt;
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>Here, the <code>item</code> is an object of type <code>java.lang.String</code>. This causes errors when run on Tomcat.</p>