Angelo, I like your solution using the DispatchAction and setting validate="false". I am currently using multiple action mappings. However, will the client-side javascript validation be generated using that scheme? Does the <html:javascript> tag look at the "validate" attribute in the config?
Scott Mulligan -----Original Message----- From: Angelo zerr [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 16, 2006 1:47 PM To: Struts Users Mailing List Subject: Re: - Design Issue with Struts Validation Hi, Me, I use DispatchAction, and I prefer call validate in my action, instead of struts launch automaticaly validate (validate="true" in action). So in my struts-config, I have just one mapping for an action (I set validate="false"). After in my dispatchAction I design my DispatchAction with several dispatch : * display dispatch which load data which must be all time loaded (when you arrive for the first time in the page and after an error). Usually this date are list used in html:select. My dispatch return ActionForward to my JSP. All my dispatch in this action (load, create, update,...) call this dispatch. * load dispatch which load data (but not list for the combo). This dispatch is called just at first time. For example if you have UPDATE form, you want load the record to fill the form. * create/update... dispatch which validate form, and if there is error, return to display dispatch, otherwise save data in my Database, and after call load dispatch to reload record comming from database. I created an OpenSource project which design Actions Struts with display/load/ dispatch. It's an application whith Struts/Hibernate/Spring and AJAX called GestCV. If you want you can go at http://gestcv.sourceforge.net/index.html to download it. If you can read Frensh, I explained this design to http://gestcv.sourceforge.net/fr/architecture/struts.html#Action Struts. I'm sorry, it's in frensh, but I will translate it in english soon. Regards Angelo 2006/5/16, Frank W. Zammetti <[EMAIL PROTECTED]>: > > Hi, > > Create two different mappings, one for the initial view (which has > validate set to false), one for the submission (with validate set to > true). > > Frank > > -- > Frank W. Zammetti > Founder and Chief Software Architect > Omnytex Technologies > http://www.omnytex.com > AIM: fzammetti > Yahoo: fzammetti > MSN: [EMAIL PROTECTED] > Java Web Parts - > http://javawebparts.sourceforge.net > Supplying the wheel, so you don't have to reinvent it! > > On Tue, May 16, 2006 1:07 pm, J Gotsch wrote: > > When I go to a page for the 1st time, the validation takes affect. > > Obviously I don't want that, I only want to validate upon > submitting. How > > do I get around this? > > > > My form extends ValidatorActionForm > > > > My Action Mapping in Struts-Config: > > > > <action path="/request/callingcard/callingCardDeactivate" > > type=" > com.its.action.request.callingcard.SubmitCallingCardDeactivateAction" > > name="callingCardDeactivateForm" > > scope="request" > > validate="true" > > input="callingCardDeactivate"> > > <forward name="requestEntryPage" path="callingCardDeactivate" /> > > <forward name="draftCallingCard" > > path="requestDeactivateCallingCardDraft" /> > > </action> > > > > > > --------------------------------- > > How low will we go? Check out Yahoo! Messenger's low PC-to-Phone > > call rates. > > > --------------------------------------------------------------------- > 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]