struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Miller" <>
Subject Nested tags confusion
Date Wed, 21 Feb 2007 23:39:44 GMT

I'm having extreme difficulty getting my application to work with nested

My form is very simple: it consists of a string and a DTO Object. The DTO
Object in turn contains a List that holds another DTO Object: Form -> Bean
-> List.
Currently I can display data with no trouble but updating data does not
work. I get a variety of very informative errors but and occasionally get no
errors at all. In either case, I am not able to retrieve any updated data in
my Action.

My guess is that I need something to help Struts auto-populate the form. I'm
very new to Struts though so all of this is still pretty mysterious.

Additionally I'm stuck with Struts 1.1x and am unable to update/change/add
any jars.


*The Form*
public class UserInfoForm extends ActionForm
 private String callType;
 private UserInfoDTO userInfoDTO = new UserInfoDTO();

 public UsocMaintenanceForm() {

 public UserInfoDTO getUsocMaintenanceDTO() {
  return userInfoDTO;

 public void setUserInfoDTO(UserInfoDTO userInfoDTO) {
  this.userInfoDTO = userInfoDTO;

 public void setCallType(String callType) {
  this.callType = callType;

 public String getCallType() {
  return callType;

public class UserInfoDTO
  private String userName;
  private List gadgetList;

  public UserInfoDTO() {

  public String getUserName() {
    return userName;

  public void setUserName(List gadgetList) {
    this.gadgetList= gadgetList;

  public List getGadgetList() {
    return gadgetList;

  public void setGadgetList(String userName) {
    this.userName = userName;

  public GadgetDTO getCreateGadgetDTO( int index )
 while( gadgetList.size() <= index )
  gadgetList.add( new GadgetDTO() );

 return (GadgetDTO)gadgetList.get( index );

*public class GadgetDTO
 private String description;
 private String cost;

 public String getDescription() {
   return description;

 public void setDescription( String description ) {
   this.description = description;

 public void setCost( String cost ) {
   this.cost = cost;

 public String getCost() {
   return cost;
*Part of the JSP*
<html:form action="/">
<nested:nest property="userInfoDTO">
  <nested:iterate property="gadgetList" type=""
      <td><nested:text name="createGadgetDTO" property="description"
indexed="true" /></td>
      <td><nested:text name="createGadgetDTO" property="cost" indexed="true"
<%-- buttons --%>

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