• Post Reply Bookmark Topic Watch Topic
  • New Topic

Urgent: How to use Indexed Properties

Prashant Vasudeo
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to use the nested tags in form bean . please help me on this.
I have a form which will have 8 element (textbox,radio box,...) in one row
and user have (add and delete buton) after the user clicks on + button one row should be displayed in the screen.
I tried this using nested tags.but giving some errors. also
It is possible that after user has entered the data the formbean will be populated with the user data?
please help as i have trying it for 3 days ..and i have to delivery on monday.
the code is as follows
Form Bean
public class TestBean extends XmlCoeActionForm {
private MyBean myBean;
private String attb = "attribute";
public TestBean() {
Logger.writeDebug("creating TestBean.............");
this.myBean = new MyBean(this);
public MyBean getMyBean() {
Logger.writeDebug("getting MyBean.............");
return this.myBean;
public void setMyBean(MyBean mybean) {
Logger.writeDebug("setting MyBean.............");
this.myBean = mybean;
public String getAttb() {
Logger.writeDebug("getting arrb.............");
return this.attb;
public void setAttb(String attb) {
Logger.writeDebug("setting arrb.............");
this.attb = attb;
my MyBean class
public class MyBean {
private TestBean testbean;
private ArrayList myBeanList= new ArrayList();
private String newButton;

public MyBean(TestBean testBean) {
Logger.writeDebug("creating MyBean.........");
/* set the master bean */
this.testbean = testBean;
this.myBeanList = new ArrayList();
ActualBean bb = new ActualBean(this);

public Object[] getMyBeanList() {
Logger.writeDebug("getting MyBeanList.........");
return this.myBeanList.toArray();

public void setMyBeanList(Object[] newMyBeanList) {
Logger.writeDebug("setting MyBeanList.........");
this.myBeanList = new ArrayList();
for (int i = 0; i < newMyBeanList.length; i++) {

public void setNewButton(String empty) {
Logger.writeDebug("setting NewButton.........");
ActualBean bb = new ActualBean(this);

my ActualBEan class
public class ActualBean {

private String txtLeftValue;
private String txtRightValue;
private MyBean myBean;
public ActualBean(MyBean myBean){
this.myBean = myBean;
* @return
public String getTxtLeftValue() {
return this.txtLeftValue;
* @return
public String getTxtRightValue() {
return this.txtRightValue;
* @param string
public void setTxtLeftValue(String txtLeftValue) {
this.txtLeftValue = txtLeftValue;
* @param string
public void setTxtRightValue(String txtLeftValue) {
this.txtRightValue = txtLeftValue;
my Jsp is
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@page import="com.chase.xmlcoe.xmltoolkit.codegenerator.mappingservice.MyBean" %>
<%@page import="com.chase.xmlcoe.xmltoolkit.codegenerator.mappingservice.TestBean" %>

<form name="test" action="/xmlcoe/test.do" method="post">
<input type="hidden" name="actionKey" value="SUBMIT">

<jsp:useBean id="bean" class="com.chase.xmlcoe.xmltoolkit.codegenerator.mappingservice.TestBean"/>
<jsp:getProperty name="bean" property="myBean"/>
<% MyBean myBean = bean.getMyBean();
out.print("myBean is:"+myBean);
System.out.println("myBean is:"+myBean);
Object obj[] = myBean.getMyBeanList();
out.print("obj.length is:"+obj.length);
System.out.println("obj.length is:"+obj.length);
System.out.println("obj is:"+obj);
<nested:nest property="myBean">
<nested:submit property="newButton" >NEW Button</nested:submit>
<nested:iterate property="myBeanList">
<nested:text property="txtLeftValue" />
<nested:text property="txtRightValue" />
The error shoen is myBean is not found in any scope.
if i comment the iterator for myBeanList it shows the button generated
but if try to get values for txtLeftValue,txtrightValue , it is giving error.
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!