Sorry, I've search for hours but can't seem to find the answer to this basic problem.
I'm building a shopping cart for the first time in struts. I have a display cart jsp that will show each item, and as expected, i have a qty textbox for each item and an update cart button. so each qty field will have to have, as part of its name, an id to tie it to the particular item in the cart. there is another field in each row, a "remove" checkbox, so i can't just name it the id. the cart hangs out in the session scope, and has a List of CartItem objects called "items". the action, when called to show the cart, will call cart.getItems() and stick the List in the request, so that it can easily be referenced by the c:foreach tag that i will be using to create the html. So the only way i can figure to get those qty fields in the request to be set in the ActionForm, upon form submission, is to use a map in the ActionForm, since i won't know how many items there will be. So the ActionForm ends up with all of the qty fields in the map, with the key being the name attribute from the textbox, and the value being the quantity typed in by the user. So in the action upon form submission i can iterate through the keys, filter out all keys that start with "qty" and update the qty for those items. So this seems a little hackish, i was wondering if there's a better way, and secondly, what exactly do i have to name those textboxes to get struts to recognize that they are pointing to a Map. I'm guessing that it will be mapname.key, is that correct? Dave --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]