Robert wrote: > > What we have come across often is that a form might support multiple > > business objects. While you can do this with struts by having the > > FormBean talk to your multiple objects, it isn't exactly intuitive > > (well, for me). > > Precisely! that is so true, who says that there is a one to one > relationship > between View and Model? of course, although FormBean > really should be considered Model, but more like a psedo model, > or an abstraction layer object, kinda of like a boundary object in a > way, > nevertheless, the whole process is a bit painful?
Nothing in Struts says there a 1:1 relationship between the View and Model. Quite the opposite. The point of the ActionForm is to provide a buffer so that validated input can be transferred to the Model. AFAIK, most developers consider the ActionForm a denizen of the presentation layer. It is part of the View, and typically the Action is responsible for Most often, developers complain that Struts does *not* provide a mechanism which assumes there is a 1:1 relationship between the View and Model. On the other hand, developers who are working with existing Models, not specifically designed for the Web application at hand, find the ActionForms quite convenient, since they give a place to put the View's input while you map it to the Model. Creating an ActionForm bean to buffer the HTML control input is a pain, but what are the alternatives if you want to validate data and offer it back to the user for correction? And if you don't need to validate and correct input, then you don't need to use ActionForms at all. The request is passed to the Action, and so it can get what it needs from there. The Struts tags can use any JavaBean, the form bean specified by the mapping is simply a default. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Building Java web applications with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>