aspose file tools*
The moose likes Struts and the fly likes form values accessed in Action code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "form values accessed in Action code" Watch "form values accessed in Action code" New topic

form values accessed in Action code

A knibbs
Ranch Hand

Joined: Aug 23, 2006
Posts: 158
I have written a form that will be displayed to the user and it will show them between 0 and 20 textfields. All of them are editable. The issue that I am not sure how to solve is how would I go about getting the 0-20 variables out in the Action code. That is to say how would one go about pulling them back without the extremely ugly manner of pulling back each value on it's own.

A concrete example:
List of products on the screen.
User is able to modify quantity field on screen. After clicking submit I want to be able to pull back all 0-20 values so that I can update the values in the backend appropriately.

Any suggestions or thoughts would be greatly appreciated.
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Two words...indexed properties. Search this forum or the Internet and you are bound to find some information (there is a good page in the Struts FAQ on the apache site). Indexed properties can be a bit tricky, so come back if you have some specific questions.

- Brent
A knibbs
Ranch Hand

Joined: Aug 23, 2006
Posts: 158
Great thanks for the starting point, I was running out of search phrases that made any sense.
It is sorta covered in the JavaRanch Style Guide.
subject: form values accessed in Action code
Similar Threads
clear dynavalidator form
Struts +retriving data.
Filters and ActionForms
Struts 1.2.9 +text areas.
clear session scoped variable values