Hi Down Under, thanks for the reply. I figured that the form properties setting thing must be struts, after checking out the JSP spec. JSP does do a certain amount of it though, since you can specify a tag in your jsp and say parameters="*" - and JSP will match any parameters in the request to methods on the tag's bean.
Anyway sorry for sounding like such a dumbass but I've been through your tutorials. For the display, I've got the nested tags sussed - it's for the save on submit that I'm having problems. It's one of those aggravating problems that I can't pin down so it's difficult to ask the right questions. I've actually hacked out some code to stuff the request parameters into the bean structure by hand in the form's validate method. Obviously I'd like to do it automatically but I had to get the app working. To try to sort out what I've done wrong, I'll strip it back to the simplest bare bones and take it from there. What I can't work out from playing with your SavingMonkey demo is how struts gets the request parameters into beans inside each other inside the formbean. Is it necessary to instantiate the right amount of empty beans first? I see SavingMonkey instantiates everything on construction. When saving request parameters to the beans in the formbean, does struts call the beans' getter methods to get the ArrayLists and beans? I can't see how else it would get access the setter methods on the deeper nested beans. Thanks for your help. I did see a message in the archives here but I can't find it again, where you were talking about changes awaiting acceptance in CVS - is that just stuff that is now incorporated into struts 1.1? I'm using 1.0.2 All the best, Adam Arron Bates wrote: >> >> >> I know JSP will automatically save parameters to a javabean with the >> correctly named getters and setters, but there's obviously a gap in my >> knowledge because all my attempts to recreate the situation above have >> failed. > > > Setting form properties against beans is a Struts thing, not a JSP > thing. The property thing is a Bean thin and can be looked up in the > JavaBean spec. > > The example you quote... > > "monkeyTeamAlpha.monkeyWorkers[0].salary" > > ...is a nested property. An invention implemented within Struts > (Craig?). What it basically is, is a string of calls rather than the > single property method. Here, it will get a hold of the form bean, get > a hold of the bean returned from the "monkeyTeamAlpha"property. On > this bean, it will invoke the indexed property "monkeyWorkers[0]" > which will pluck a bean from a collection or index provided, from this > last bean it will will get a hold of its "salary" property, and set > the value. > > All this boils down to, is that you can compose objects a little > cleaner, rather than have truly enormous beans for everything. Having > the indexed properties allows for lists and whatever else. > > The ability for nesting beans has been in Struts for a long time. The > nested tags just make it much easier. > > There's a primer and tutorial for nested beans here... > > http://www.keyboardmonkey.com/next > > ...it should take you over creating and using such a construct. > > Hope this gets you on th path you're after. > > > Arron. > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>