pon., 29 wrz 2025 o 16:44 Prasanth <[email protected]> napisał(a):
>
> That was my thinking until ArrayList was not populated when I had the 
> StrutsParameter on getXXX. For ArrayList the annotation has to be on setXXX.

But how do you set values on the list, could you show an example JSP form?

I was testing this using a User entity with List/ArrayList and all
works as expected

@StrutsParameter(depth = 2)
public List<User> getUsers() {
    return users;
}

<s:form action="index" method="POST">
    <s:iterator value="users" status="status">
        <s:hidden name="users[%{#status.index}].id"/>
        <s:textfield name="users[%{#status.index}].name" label="User
%{users[#status.index].id}" id="user_%{users[#status.index].id}"/>
    </s:iterator>
    <s:submit/>
</s:form>


Cheers
Łukasz

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to