1

I am trying to invoke a method inside a loop in jstl but when I type in period after SQLHelper I am not getting the method name.

<%@page import="com.servlet.session.SQLHelper"%>
<c:set var="pc" value="${0}" />  
<c:forEach var="report" items="${report2}" varStatus="iter">
<tr id="test">
<c:set var="pc" value="<% pc + SQLHelper.GetCount(${report.id}, ${d1},   ${d2}); %>" />

</c:forEach>

what is the correct way to call the method?

user3666197
  • 1
  • 6
  • 50
  • 92

1 Answers1

0

Please have a look at this approach.

Also please note that you can only call methods with arguments in EL if you're running a Servlet 3.0 compatible container (e.g. Tomcat 7, Glassfish 3, JBoss AS 6, etc) with a web.xml declaring Servlet 3.0.

Community
  • 1
  • 1
teksan
  • 142
  • 13