Hi, everyone,
I want to ask a question about the JSP. I writing the following code in the JSP page. However, when I set the <%= obj.getCounter()%>
(use-defined method) to be the loop counter, I found that it does not work. Can anyone help me? Thank you.
The following is the code.
<%
private int loopTime = <%= obj.getCounter()%>;
%>
<% for(int i=0; i<loopTime; i++) { %>
<tr>
<td><%= obj.getName() %></td>
<td><%= obj.getAge() %></td>
</tr>
<%}%>