Mike,

What error are you getting....
 
-Sam.

Mu Mike <[EMAIL PROTECTED]> wrote:
Hi, all, last week, I spent a whole day trying to figure the below problem 
out, and you warmhearted guys just came and helped me,but to greatly 
disappiont you, I m still at a loss to know where the problem is ,so I 
decided to explain detailedly and completely of what I did and hope you 
nice buddies can help me find the problem


goal: I want to submit an array of Fonbean(java class file listed below) to 
an action
strategy: I decide to use html:form and logic:iterate to do this

1.what I have in my configruation xml


type="com.mycom.form.TestBeanForm"/>



type="com.mycom.action.TestAction"
name="testBeanForm"
scope="session">



2.TestBeanForm.java

public class TestBeanForm extends ActionForm {

public FontBean[] getTestBean() {
if(testBean==null)
{
testBean=new FontBean[2];
testBean[0]=new FontBean();
testBean[1]=new FontBean();
}
return testBean;
}

public void setTestBean(FontBean[] testBean) {
this.testBean = testBean;
}

FontBean[] testBean;
}


3. FontBean.java

public class FontBean {
public int getSize() {
return size;
}

public void setSize(int size) {
this.size = size;
}

public String getFontName() {
return fontName;
}

public void setFontName(String fontName) {
this.fontName = fontName;
}

private int size;
private String fontName;

}

4. my jsp file


type="com.mycom.bean.propertybean.FontBean" id="mybean" indexId="index1">
indexed="true"/>

/* I think when I submit, the testBeanForm will automatically fill 
its testBean's elements of their fontName attributes with "font1" */


Submit Changes



5.my action class file

public class TestAction extends Action {
public ActionForward execute(ActionMapping actionMapping,
ActionForm form,
HttpServletRequest servletRequest,
HttpServletResponse servletResponse) 
throws Exception
{
System.out.println("stepped into action");
TestBeanForm bform=(TestBeanForm)form;

/*I stopped here to check if the form has its testBean variable filled 
with
"font1" of its fontName attribute, but it doesnt, the testBean of form is 
just the object I created in getTestBean(),that is, contains two elements, 
both the fontName attributes of the two elements are null */

return actionMapping.findForward("error");
}
}



so what on earth is the problem?

Thanks&Regards
Mike

_________________________________________________________________
享用世界上最大的电子邮件系统— MSN Hotmail。 http://www.hotmail.com 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam

Reply via email to