I have a servlet with:
request.setAttribute("agenzieList",businessLogic.findAllAgenzia());
rd = getServletContext().getRequestDispatcher("/prenotazioneAg.jsp");
rd.forward(request, response);
And in my jsp I want to use my list with the select option. I'm new with JSTL and I tried so:
<select name="agenzia" onChange="toggleSubmit('d',this)">
<c:forEach items="${agenzieList}" var="agenzia">
<option value="${agenzia.idAgenzia}">${agenzia.nome}</option>
</c:forEach>
</select>`
If I write only ${agenzieList}
in my jsp I can see my full list with every element.
But my selection box remains empty. So the problem I think is in the foreach syntax.
Where is my error? I don't understand.