Re: Init of forms

2006-09-27 Thread Andy.de
Andy.de <[EMAIL PROTECTED]> > To: user@struts.apache.org > Sent: Tuesday, September 26, 2006 5:13:12 PM > Subject: Re: Init of forms > > > Hi Antonio, > i do not understand. The action is executed if the form is submitted, this > is > after the jsp has been displ

Re: Init of forms

2006-09-27 Thread Ilja S.
Hi Lets see in example you declare an action in struts-config like this: type="com.example.struts.action.RegistrationAction" validate="false"> Now when you access "/registration" url Your Action's class "execute" method will be called. Inside this method you get instance of "registra

Re: Init of forms

2006-09-26 Thread Antonio Petrelli
Andy.de ha scritto: Hi Antonio, i do not understand. The action is executed if the form is submitted, this is after the jsp has been displayed. Yeah, you're right I was missing a point. You have to call ANOTHER action that prepopulates an object and puts it, for example, in request scope, the

Re: Init of forms

2006-09-26 Thread Yamir Encarnacion
action in the example. You can get struts 1.1 from http://archive.apache.org/dist/struts/struts-1.1/ Yamir - Original Message From: Andy.de <[EMAIL PROTECTED]> To: user@struts.apache.org Sent: Tuesday, September 26, 2006 5:13:12 PM Subject: Re: Init of forms Hi Antonio, i do not unde

Re: Init of forms

2006-09-26 Thread Andy.de
Hi Antonio, i do not understand. The action is executed if the form is submitted, this is after the jsp has been displayed. I want to fill the form with values from database before the jsp is displayed. I need the typical 'edit' function, not create. Regards, Andy apetrelli wrote: > > Ilja S. h

Re: Init of forms

2006-09-26 Thread Andy.de
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 r

Re: Init of forms

2006-09-26 Thread Ilja S.
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 requ

Re: Init of forms

2006-09-26 Thread Antonio Petrelli
Ilja S. ha scritto: 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 inst