Thanks a lot for all your input and help. It looks like I need some basic concepts clarified. Here a very short background of the application and what my intension is:

The object 'subscriber' is a special business object: it represents the logged in user and contains a lot of information about him: Personal data like name, address, e-mail, preferred language etc. But it contains also information about his roles, type of subsciption he bought etc. Shortly I need parts of this information almost everywhere in the application and thats why the thing sits in session scope.

The action we were discussing 'changePersonalDataForm' represents a form where the user can change some of this informations such as personal data, language etc. Other things such as roles, subscibtion information etc are not visible to the user. The object has logic to retrieve its information from various database tables and also store information back if there are changes. This is performed exclusively in this object not in any action. The object is created and filled when the user has successfully logged in.

So I used
<html:text value="${sessionScope.subscriber.firstname}"
     property="firstname" name="firstname" maxlength="64"
     size="32"/>

to initially fill the firstname directly from the business object into the form. If the user submits the form the information is updated in the object and also written back to the DB server. Nice things like ChangeEventListeners as available in Swing and also in JSF are sort of missing in Struts (at least I did not find something alike)

So the key question seems to be:

What is the correct or preferred way to link business-objects with form beans. Is this only possible by copying data from a business object to a form bean or is there any 'smarter' way? Copying ends up in writing a lot of copy-code which is inefficient. I am looking for sort of a component model, which means I have a couple of objects in session or even application scope and can directly use then in many different forms/actions. But so far I am missing a concept like SWING controls do have it where you can bind controls such as a listbox, textbox etc directly to objects or even database tables. I think JSF offers similar things but I don't see anything alike in struts 1.2.8 (the version I am currently using).

Maybe someone could clarify these things for me or you may have some good recipes for me, how to solve these things best with Struts.


Many thanks again for your help!

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to