The problem is that ctr not an implicit object and is not located in any of the areas (query, session, etc.), so it is not included in the scope of EL expressions.
To fix this, you have basically two options:
OPTION No. 1 (outdated)
Use scripts (remember to import the Schedule class at the beginning of your JSP):
<% Time[] times = (Time[]) session.getAttribute("times"); int rowCount = times.length; for(int ctr = 0; ctr < rowCount; ctr++) { %> <tr> <td><%= ((Schedule)session.getAttribute("schedule")).malls[ctr] %></td> <td class="cinema"><%= ((Schedule)session.getAttribute("schedule")).cinemas[ctr] %></td> <td>PHP <%= ((Schedule)session.getAttribute("schedule"))..prices[ctr] %></td> <td><%= ((Schedule)session.getAttribute("schedule")).dates[ctr] %></td> <td><%= ((Schedule)session.getAttribute("schedule")).times[ctr] %></td> </tr> <% } %>
OPTION number 2 (politically correct)
You will need to reorganize this Schedulle class and use JSLT tags, for example:
<c:forEach var="rowItem" items="${rowList}" > <tr> <td>${rowItem.mall}</td> <td class="cinema">${rowItem.cinema}</td> <td>PHP ${rowItem.price}</td> <td>${rowItem.date}</td> <td>${rowItem.time}</td> </tr> </c:forEach>
Remember to declare taglib at the beginning of your JSP:
<% taglib prefix="c" uri="http://java.sun.com/jsp/jslt/core" %>
I have not tested this, since I have no way to debug JSP right now, this is for you to get an idea of โโyour options.
source share