struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Using sets of objects with tags
Date Wed, 02 Apr 2008 21:26:32 GMT

> You don't need to 'parse the stream', Struts does that for you. Struts
> will call the setters on the objects in your set to pass the form inputs
> into them. In other words, the result you want to achieve is what
> happens automatically, provided you specify your input fields correctly.
> L.

Hmmmm, thought I had tried that. How do I retrieve those objects then?

For example, in the first Action I create a set named 'students', and fill
it with Student objects.

In the .jsp, I iterate over the set of students, like so:
(please ignore the table, this is just preliminary formatting, .css is on
the way)

<s:form action="TheNextOne"

      <s:iterator status="stat" value="students">


            <s:hidden name="userId" />

            <td><s:property value="#stat.index + 1" />.</td>

            <td><s:textfield name="lastName" /></td>

            <td><s:textfield name="firstName" /></td>

            <td><s:textfield name="userName" /></td>

            <td><s:textfield name="userPassword" /></td>




Is this incorrect? If not, how then do I retrieve the set of modified
student objects in the submit Action?


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

View raw message