Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting array from html to jsp beans

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am having problem getting the complete array from my html form to my beans. The situation here is as follow:

1) I have a dynamic form that will loop itself. Eg. The user key in 5 and my jsp will generate 5 forms. Each form will be declared as 2-dimensional array say in this case,
Code:
String[][] newForm = new String[userKeyIn][2];

2) Problem, how to get the value into my beans? I want to get all the value into my bean so that I can use it. I uses the set and get method for my normal (not array) values.

3) This is what I wrote in my bean.
Code:
private String[][] myArray;

public void setNewForm(input[][]){
  myArray = new String [getUserKeyIn()][2];
  myArray = input;
  }

public String[][] getNewForm(){
  return myArray; 
  }
4) Somehow, nothing goes into my myArray.
Any solution for this?


Many thanks in advance,
gene_ ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top