i have a bean name "Student" consists of name, address, age, mobile.
I can display all the students details in jsp by query the database and inserting each records in Student bean, so the Student list will look like
and the iterator in jsp is like
How can i get the student list in action so that i can iterate it and persist it into database. (i do have getters and setters of the list in action)
Any suggestion / Comments would be great.
ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
As per my understanding, you are sending studentlist from action class and displaying it in jsp file. Action action execution all the data in the valueStack will be nullified. So, you can't get the studentlist. Here you have 2 solutions
1) putting the data in session to reduce no of hits to the database. 2) Again make a database call.
3) you can use chain as result type. It will carry forward valueStack data to configured action. http://struts.apache.org/2.0.14/docs/chain-result.html
thanks for your response.
you are correct that i am sending studentlist from action class and displaying it in jsp file where the user can make changes and when the user hit the update button the form is submitted,
all i need is the list with the updated values in action, since i am submitting the form i think i cannot use "chain" here because now my jsp is like