struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charles Canning" <>
Subject [OT] Problem with JSTL (using struts)
Date Thu, 31 Jul 2003 17:54:41 GMT

Sorry to send this to this list. If someone can recommend a better source
for help, please do. I am using JSTL and struts-el in a form, but the
foreach is not returning my values. If I use a scriplet, I see them. Here is
the scenario/code in same JSP

    List alist;
    Iterator iterator;
    MessageHeader mHeader;

    alist = (List)request.getAttribute("headerList");
    //get the iterator
    iterator = alist.iterator();
    //step through
    while (iterator.hasNext() == true) {
        mHeader = (MessageHeader);
          sender <%=mHeader.getSender()%><br>
          subject <%=mHeader.getSubject()%><br>
          messageId <%=mHeader.getMessageId()%>

<c:forEach items="${headerList}" var="header">
    <c:when test="${index} % 2 == 0">
      <TR bgcolor="FFEDED">
      <TR bgcolor="FFD8D8">
    <c:out value="${header.sender}"/>
    <c:out value="${header.subject}"/>
    <c:out value="${header.messageId}"/>
    <html-el:multibox property="values" value="${header.messageId}"/>
  <td align="left" width="25%" class="subtext">
    <c:out value="${header.sender}"/>
  <td align="left" width="50%">
    <c:out value="${header.subject}"/>
  <td align="right" width="25%">
    <fmt:formatDate value="${}" type="BOTH" dateStyle="LONG"

The scriplet shows all the fields, the JSTL/el tags show no values, but it
does have do the correct number of iterations through the list.

Any help would be greatly appreciated.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message