struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xnpeng <xnp...@163.com>
Subject struts2 iterator list mapping --ReST
Date Thu, 19 Mar 2009 15:34:39 GMT
in struts2-REST environment,i cannot run struts2/showcase/person example.
 
in struts2/showcase/person,there is a <s:iterator>:
<s:form action="person/person" theme="simple" method="post" validate="false">
    <table>
        <tr>
            <th>ID</th>
            <th>First Name</th>
            <th>Last Name</th>
        </tr>
        <s:iterator var="p" value="persons">
            <tr>
                <td>
                    <s:property value="%{id}"/>
                </td>
                <td>
                    <s:textfield label="First Name" 
                       name="persons(%{id}).name" 
                       value="%{name}" theme="simple"/>
                </td>
                <td>
                    <s:textfield label="Last Name" 
                       name="persons(%{id}).lastName" 
                       value="%{lastName}" theme="simple"/>
                </td>
            </tr>
        </s:iterator>
    </table>
    <s:submit method="update" value="Save all persons"/>
</s:form>

the action.update:
    public HttpHeaders update() {
        System.out.println("=======update");
        for (Person p : persons) {
            personManager.getPeople().remove(p);
            personManager.getPeople().add(p);
        }
        return new DefaultHttpHeaders("index");
    }
 
when i submit the form,there is lots of exceptions for each input field:
ognl.OgnlException: Error getting property descriptor: null
just before ("=======update");
seems to have no value transfer to action variable: List person. 
 
how to manage this?
thanks
 

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