struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy.de" <a.schm...@best-blu.de>
Subject Re: Init of forms
Date Tue, 26 Sep 2006 21:07:18 GMT

Hi Ilja,
i'm using DAO patterns but the question was: how can i init a form inside an
action. I Didn't
find any method to do this and also no example. All struts samples are with
forms to create
new objects and not to edit existing objects.
regards, Andy

Ilja S. wrote:
> 
> Hi
> Action class is right place.
> Common way is to have some layer working with DB like DAO pattern. Then 
> You can have some service layer between DAO and Action which you call 
> from Action class.
> Call it, get data transfer object from DB, copy its properties to 
> ActionForm instance and forward request to your jsp page with form. 
> Struts will do the rest. That is all.
> 
> Andy.de wrote:
>> Hi folks,
>> i init my form beans at reset(...) of ActionForm from database but i
>> think
>> this is not correct because
>> if an error occurs i have no chance to forward to an error page or to
>> save
>> ActionErrors. I think the
>> controller must read objects from database and init the form.
>> All samples are very simple and only with forms for new objects (name="";
>> street=""; at reset()).
>> Where is te correct place to init forms from database if i want edit an
>> existing object and which method must i call????
>> I'm using Struts 1.2.9
>> 
>> Regads, Andy
> 
> 
> -- 
> *************************************
> Best Regards
> Ilja
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Init-of-forms-tf2337990.html#a6515887
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message