First, in my humble opinion, having one Action serving several actions was the reality welcoming the pink vision of having a small action doing different thing. Now, combining the two solutions as they are is quite impossible since they both make use of the same action mapping 'parameter' field. There is however a nice-looking way around it. I can write our own version of base ActionForm override the validate(mapping, request), ignore the validation only if the 'parameter' is equal to "init" (as a convention, as a rule in the specific application). Therefore setting validation=true will be ignored when parameter="init" and in all other cases will perform the validation.
To use the DispatchAction I would write the same base MyBaseForm, but this time, it will imitate the DispatchAction and will look if the value of the named parameter is "init". I think that solves it. Erez -----Original Message----- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 3:32 PM To: Struts Users Mailing List Subject: Re: Actions Best Practice I thought that was exactly what you were doing! Erez Efrati wrote: > The only thing you cannot do is having a mixture of this solution > (having the action-mapping parameter set to the 'init' or else) and the > one of DispatchAction class that keeps all the operation under the same > roof (class). > > Erez > > -----Original Message----- > From: Adam Hardy [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 06, 2003 3:00 PM > To: Struts Users Mailing List > Subject: Re: Actions Best Practice > > That's not necessary. In the action mapping, you can specify the action > parameter with parameter="init" or parameter="send". > > Erez Efrati wrote: > >>Taking your advice, it means that I would have two different action >>mappings, one for the init step and the second for the actual action >>(send). >>But then I will have to write something like >><html:link page="/InitForgotPassword.do?action=init"> which is a bit >>strange to write again the "init", and it is needed cause the >>ForgotPasswordAction.java needs this 'action' parameter to distinguish >>between the two. Hmm.. >> >>Erez >> >>-----Original Message----- >>From: Adam Hardy [mailto:[EMAIL PROTECTED] >>Sent: Wednesday, August 06, 2003 11:43 AM >>To: Struts Users Mailing List >>Subject: Re: Actions Best Practice >> >>Erez Efrati wrote: >> >> >> >>>One of the problem I found with 'action=init' method, is that the >>>validation is activated automatically for both cases (both init & >> >>send), >> >> >>>and fails of course on the 'init' cause no field is yet in the form. >> >>So >> >> >>>I was forced to configure 'validate=false' and call it manually in the >>>Action code. >>> >> >> >>Option B would be compacter. You can write two action mappings in >>struts-config to distinguish the calls, where one has no validation > > and > >>the other does. >> >>I know some people don't like having extra action mappings in their >>struts-config, but I believe that is what they are there for. >> >> >>Adam >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]