I have a route object. It contains arrayList of options. I want to know the size of options and store it in some variable. (This thing needs to be done in JSP). I then want to access this variable in jquery. How to do it?
JSP code :
<%!int loopSize = routes.get(0).getOptions().size(); %>
<c:forEach var="route" items="${routes}" varStatus="loopCounter">
<c:forEach var="option" items="${route.options}"
varStatus="loopCounter2">
<---more code -->
</c:forEach>
</c:forEach>
But it is saying routes undefined. I am using struts2 and action class. Routes is coming from the action class