java - How to set the <%= ...> in to a loop counter? -
i want ask question jsp. writing following code in jsp page. however, when set <%= obj.getcounter()%>
(use-defined method) loop counter, found not work. can me? thank you.
the following code.
<% private int looptime = <%= obj.getcounter()%>; %> <% for(int i=0; i<looptime; i++) { %> <tr> <td><%= obj.getname() %></td> <td><%= obj.getage() %></td> </tr> <%}%>
you can't include 1 scriptlet inside another: what's point?
<% int looptime = obj.getcounter(); %>
is wanted? i'm asking because looptime
isn't 'loop counter' in code, it's loop upper boundary.
Comments
Post a Comment