2008/10/22 D'Ottavio Alessandro <[EMAIL PROTECTED]>: > if I create the FormBeanA associate with the ActionA (specific > properties with getter and setter and validate specific only for that > properties requested by function A need) struts automatically will > valorised the bean using the setter present... > and the same will be done for the Action B with the associated FormBeanB > > this will solve the problem of the validation and mean that I can use > more html:form tag associate at the same page because the submit will > request one specific action and the ActionServlet will populated the > specific Bean
OK. > > > But in this way I have another problem :) > > When I populate the FormA and I submit, the result could populate the > filed of the FormB. > That mean that when I submit the function A I should put manually in the > request also the FormB FormBean? When you submit a form, only that form will be populated, the other one in the page won't. This is related to HTTP (when you press "submit" of a form, only the fields of that form are submitted) not to Struts. > Struts will understand automatically that there is that bean? > Actually the framework automatically will populate formA with BeanA > because is in the action activated, but for the formB and BeanB? If you reason in terms of HTTP requests everything becomes clear: each field is translated into HTTP parameters, each form name (or "id") is translated into the name of the form bean, each action (of <form> tag) is translated into a Struts action. This way, you can see that the two forms are completely independent, so Struts won't get confused. What you can do is mixing up fields: you cannot submit a field that belongs to another form. Antonio --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]