struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Randy Shelley" <rshel...@asg.sc.edu>
Subject Multiple nested Hashmaps. Limit?
Date Wed, 19 May 2004 22:48:55 GMT
I am running into a problem with multiple Mapped nested properties

 

When I use the following lines to access the Value form my dynaValueObj
Object I get this error

<%

  String
value="dynaTableObj.dynaRowObjs("+rowNm+").dynaValueObjs("+key+").dynaCo
lumnValue";

%>

 

<html:text name="DynaTableDataForm" property="<%=rowNmdd%>" size="20"/>

 

[ServletException in:/WEB-INF/src/jsp/dyna/dynaTableData.jsp] Null
property value for 'dynaValueObjs(1)''

 

After tracing I found that it is not calling getDynaValueObjs(String xx)
but calling getDynaValueObjs().

 

Is there a limitation on how many map-backed properties you can
reference?

 

Thanks

Randy Shelley

rshelley@sc.edu

 

 

---------- Dyna Table Form Bean

public class DynaTableDataForm extends ActionForm {

 

  private DynaTableObj dynaTableObj = null;

 

  public DynaTableObj getDynaTableObj () {

    if (this.dynaTableObj==null) {

      this.dynaTableObj = new DynaTableObj();

    }

    return this.dynaTableObj;

  }

  public void setDynaTableObj (DynaTableObj dynaTableObj) {

    this.dynaTableObj = dynaTableObj;

  }

}

------------------------ Dyna Table Object

public class DynaTableObj {

  private LinkedHashMap dynaColumnObjs = null;

 

  public DynaTableObj() {}

 

  public void setDynaColumnObjs(LinkedHashMap dynaColumnObjs) {

    this.dynaColumnObjs = dynaColumnObjs;

  }

  public LinkedHashMap getDynaColumnObjs() {

    return this.dynaColumnObjs;

  }

  public Object getDynaColumnObjs(String dynaColumnId) {

    if (dynaColumnObjs==null) {

      this.dynaColumnObjs = new LinkedHashMap();

      this.dynaColumnObjs.put(dynaColumnId,new DynaColumnObj());

    }

    else if (this.dynaColumnObjs.get(dynaColumnId)==null) {

      this.dynaColumnObjs.put(dynaColumnId,new DynaColumnObj());

    }

    return this.dynaColumnObjs.get(dynaColumnId);

  }

 

  public void setDynaColumnObjs(String dynaColumnId,Object
dynaColumnObj) {

    if (dynaColumnObjs==null) {

      this.dynaColumnObjs = new LinkedHashMap();

    }

    this.dynaColumnObjs.put(dynaColumnId,dynaColumnObj);

  }

}

---------------------- Dyna Row Object

public class DynaRowObj {

  private LinkedHashMap dynaValueObjs = null;

 

  public DynaRowObj() {}

 

  public void setDynaValueObjs(LinkedHashMap dynaColumnObjs) {

    this.dynaValueObjs = dynaValueObjs;

  }

  public LinkedHashMap getDynaValueObjs() {

    return this.dynaValueObjs;

  }

  public Object getDynaValueObjs(String dynaColumnId) {

    if (dynaValueObjs==null) {

      this.dynaValueObjs = new LinkedHashMap();

      this.dynaValueObjs.put(dynaColumnId,new DynaValueObj());

    }

    else if (this.dynaValueObjs.get(dynaColumnId)==null) {

      this.dynaValueObjs.put(dynaColumnId,new DynaColumnObj());

    }

    return this.dynaValueObjs.get(dynaColumnId);

  }

  public void setDynaValueObjs(String dynaColumnId,Object dynaValueObj)
{

    if (dynaValueObjs==null) {

      this.dynaValueObjs = new LinkedHashMap();

    }

    this.dynaValueObjs.put(dynaColumnId,dynaValueObj);

  }

}

 

----------------------------- Dyna Value Object

package rshelley.timesheet.util;

 

public class DynaValueObj {

  private String dynaColumnValue = null;

 

  public DynaValueObj() {

  }

  public void setDynaColumnValue(String dynaColumnValue) {

    this.dynaColumnValue = dynaColumnValue;

  }

  public String getDynaColumnValue() {

    return this.dynaColumnValue;

  } 

}


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