alexander1113
Programmer
Hello all,
I am utilizing the MVC architecture via Struts. I have a page which prints out a dynamic list of text boxes and are printed as follows:
<input type="text" name="MyForm.quantity[0]" value="2"/>
<input type="text" name="MyForm.quantity[1]" value="2"/>
<input type="text" name="MyForm.quantity[2]" value="2"/>
.... COULD BE MORE TEXT BOXES COULD BE LESS...
These text boxes are all in one form. Now when there is a submit it gets set to a bean which I have created like this:
private String[] quantity;
public String[] setQuantity(String[] quantity)
{
quantity = quantity
}
public String getQuantity()
{
return quantity;
}
But I am getting null when in the action I do:
action..blah blah blah
MyForm myform = (MyForm)form
//getting my bean from the jsp form
System.out.println(myform.getQuantity());
Can anyone help. If you need more information please post, I need to get this solved and have been racking my brain.
Alex
I am utilizing the MVC architecture via Struts. I have a page which prints out a dynamic list of text boxes and are printed as follows:
<input type="text" name="MyForm.quantity[0]" value="2"/>
<input type="text" name="MyForm.quantity[1]" value="2"/>
<input type="text" name="MyForm.quantity[2]" value="2"/>
.... COULD BE MORE TEXT BOXES COULD BE LESS...
These text boxes are all in one form. Now when there is a submit it gets set to a bean which I have created like this:
private String[] quantity;
public String[] setQuantity(String[] quantity)
{
quantity = quantity
}
public String getQuantity()
{
return quantity;
}
But I am getting null when in the action I do:
action..blah blah blah
MyForm myform = (MyForm)form
//getting my bean from the jsp form
System.out.println(myform.getQuantity());
Can anyone help. If you need more information please post, I need to get this solved and have been racking my brain.
Alex