JSP 2.0

E

EdUarDo

How could I do this block with JSP 2.0?

<% List projects = (List) request.getAttribute("projects"); %>
<select name="project">
<option value="" selected>Elige opci&oacute;n</option>
<% Iterator it = projects.iterator();
while(it.hasNext()) {
Project p = (Project) it.next(); %>
<option value="<%= p.getAcronym() %>"><%= p.getDescription()%></option> <% } %>
</select>

I've included JSTL jars, and taglib directive, etc, etc...

Then I've tried these sentences, but of course, doesn't work...
<select name="project">
<option value="" selected>Elige opci&oacute;n</option>
<c:forEach var="item" items=${requestScope.projects}">
<option value="${item.getAcronym}"><c:eek:ut value="${item.getDescription}"/></option> </c:forEach>
</select>

How could I invoke a method from an object ${item.getAcronym}?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top