JSP 2.0

Discussion in 'Java' started by EdUarDo, Apr 16, 2004.

  1. EdUarDo

    EdUarDo Guest

    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}?
     
    EdUarDo, Apr 16, 2004
    #1
    1. Advertising

  2. <c:eek:ut value="${item.acronym}"/>

    EdUarDo wrote:
    > 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}?
     
    Igor N. Kolomiyets, Apr 16, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthias Nietz
    Replies:
    1
    Views:
    3,468
    VisionSet
    Nov 12, 2003
  2. Raymond DeCampo

    Custom tags and <jsp:plugin> / <jsp:param>

    Raymond DeCampo, Feb 18, 2004, in forum: Java
    Replies:
    0
    Views:
    643
    Raymond DeCampo
    Feb 18, 2004
  3. Timo Nentwig

    JSP 2.0: <jsp:attribute> in <c:if>

    Timo Nentwig, May 10, 2004, in forum: Java
    Replies:
    0
    Views:
    641
    Timo Nentwig
    May 10, 2004
  4. Sean Aitken
    Replies:
    3
    Views:
    11,131
    Alex Hunsley
    Oct 21, 2004
  5. Replies:
    0
    Views:
    4,439
Loading...

Share This Page