Como utilizar o for no JSP?

1 resposta
javawebjspjavaservlet
thiagodebonis

Estou tentando gerar tabelas a partir de uns resultados, porém ele está dando erro no “let” do for…

<div>
    <table>
        <% if(userProductListSize > 0) {%>
            <% for(let i = 0; i < userProductListSize; i++){ %>
            <tr>
                <th>Item</th>
                <th>Quantidade</th> 
                <th></th>
            </tr>
            <tr>
                <td><% userProductList.getProductRepository().getProductList().get(i).getName(); %></td>
                <td id="productQuantity"><% userProductList.getProductRepository().getProductList().get(i).getQuantity(); %></td> 
            <td>
                <button id="plus" type="button"><img src="images/plus.png"></img></button>
                <button id="minus" type="button"><img src="images/minus.png"></img></button>
                <button id="down" type="button"><img src="images/down.png"></img></button>
                <button id="up" type="button"><img src="images/up.png"></img></button>
                <button id="delete" type="button"><img src="images/delete.png"></img></button>
            </td>
        </tr>
            <% } %>
        <% } %>
    </table>
    

</div>

cannot find symbol
symbol: class let
location: class SimplifiedJSPServlet

1 Resposta

juliofsn

No lugar do “let”, use int ou long.
let não é uma keyword válida em java.

Criado 22 de novembro de 2018
Ultima resposta 22 de nov. de 2018
Respostas 1
Participantes 2