struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raghu Kanchustambham <kra...@gmail.com>
Subject Re: c:forEach does not recognize HashSet when combined with nested EL ?
Date Tue, 01 Nov 2005 18:38:27 GMT
Hi Keith,
Thanks for responding.
 However, How will this solve my problem? The problem is that the control is
not entering into the loop in the first place. And you have put additional
statements in the loop body. I have anyways tried it, and it did not work.
 Regards,
Raghu

 On 11/1/05, Keith Sader <ksader@gmail.com> wrote:
>
> You need to tell your loop to use the key or the value from your set.
>
> <c:forEach var="paymentDetails" items="${studentEnrollment.paymentDetails
> }">
> <c:out value='{paymentDetails.key}'/>
> <c:out value='{paymentDetails.value}'/>
> </c:forEach>
> ...
>
> that should fix it up.
>
>
>
> On 11/1/05, Raghu Kanchustambham <kraghu@gmail.com> wrote:
> > Hi,
> > Please look at the following code:
> > <c:forEach var="paymentDetails" items="${
> studentEnrollment.paymentDetails}"
> > >
> > studentEnrollment is a bean that I have attached to the DynaActionForm
> that
> > is configured. That bean has a Set called paymentDetails.
> > I intend to iterate over this HashSet and its just not working. Its not
> even
> > entering the loop.
> > A little hack that makes the above work however is when I write extra
> (less
> > elegant code) like:
> >
> > <%
> > DynaActionForm dynaForm = (DynaActionForm) request.getAttribute
> > ("studentEnrollmentForm");
> > StudentEnrollment se = (StudentEnrollment) dynaForm.get
> > ("studentEnrollment");
> >
> > Set paymentDetails = se.getPaymentDetails();
> > request.setAttribute("paymentDetails",paymentDetails);
> > %>
> > <c:forEach var="paymentDetails" items="${paymentDetails}" >
> > 1) this code is in-elegant
> > 2) While the loop is being entered, when this form is being "submitted"
> to
> > the action class, any details attached to text boxes for each
> > 'paymentDetails row' is not being passed back anyways! :(
> > Can someone tell me what I am conceptually wrong. I am relatively new to
> > using Struts.
> > Thanks in Advance.
> > Raghu
>
> hth,
>
> --
> Keith Sader
> ksader@gmail.com
> http://www.saderfamily.org/roller/page/ksader
> http://www.jroller.com/page/certifieddanger
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message