Re: Validation while using LookupDispatchAction
so struts is dead? we must be haunting you, right? On 23/06/05 19:52 Mark Galbreath wrote: Your sure did: C#.NET makes stuff like this soo easy! Struts is dead. ~mark -Original Message- From: Vicky [mailto:[EMAIL PROTECTED] Sent: Thursday, June 23, 2005 2:48 PM But having different actions in struts-config. how would I call them in my jsp html:form ? because right now I have only one action in jsp and then for each button i have property="method".. in jsp in struts-config for this action mapping I have parameter="method" Did I miss anything in here? This email and any file transmitted with it may be confidential and is intended solely for the use of the individual or entity to whom it is addressed. If you received this email in error please notify the DBM Service Desk by forwarding this message to [EMAIL PROTECTED] This email has been scanned by networkMaryland Antivirus Service for the presence of computer viruses. - 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]
Re: Validation while using LookupDispatchAction
You might be interested in checking out ValidatorLookupDispatchAction (http://struts.whoisandy.com/archives/2005/05/27/validatorlookupdispatchaction.php). I stumbled across, but never actually used it. ~ Andrew Tomaka On 6/23/05, Wendy Smoak <[EMAIL PROTECTED]> wrote: > From: "Vicky" <[EMAIL PROTECTED]> > > > > But having different actions in struts-config. how > > would I call them in my jsp html:form ? because right > > now I have only one action in jsp > action="myAction"> and then for each button i have > > property="method".. in jsp > > > > in struts-config for this action mapping I have > > parameter="method" > > > > Did I miss anything in here? > > DynaValidatorActionForm wants to validate based on the path, so you have to > give it different paths to work with. If you can't or don't want to have > different paths mapped to the same action and form, then a different > solution is in order. > > I doubt you are alone... I wonder if someone has written a flavor of > ValidatorForm that uses the dispatch parameter to switch validation. None > comes to mind, but search the list archives and the Wiki to see if there is > already something out there. > > And of course you're always free to override 'validate' in your form bean > and make it do exactly what you want, or to turn off automatic validation > altogether and call it from your Action when and where you want it to > happen. > > If you're having trouble deciding what the best approach would be, tell us > more about your project and I'm sure there will be no shortage of opinions. > (Hey, Mark, welcome back! So, tell us how you REALLY feel about Validator... > ;) ) > > -- > Wendy Smoak > > > - > 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]
Re: Validation while using LookupDispatchAction
From: "Vicky" <[EMAIL PROTECTED]> > > But having different actions in struts-config. how > would I call them in my jsp html:form ? because right > now I have only one action in jsp action="myAction"> and then for each button i have > property="method".. in jsp > > in struts-config for this action mapping I have > parameter="method" > > Did I miss anything in here? DynaValidatorActionForm wants to validate based on the path, so you have to give it different paths to work with. If you can't or don't want to have different paths mapped to the same action and form, then a different solution is in order. I doubt you are alone... I wonder if someone has written a flavor of ValidatorForm that uses the dispatch parameter to switch validation. None comes to mind, but search the list archives and the Wiki to see if there is already something out there. And of course you're always free to override 'validate' in your form bean and make it do exactly what you want, or to turn off automatic validation altogether and call it from your Action when and where you want it to happen. If you're having trouble deciding what the best approach would be, tell us more about your project and I'm sure there will be no shortage of opinions. (Hey, Mark, welcome back! So, tell us how you REALLY feel about Validator... ;) ) -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validation while using LookupDispatchAction
Your sure did: C#.NET makes stuff like this soo easy! Struts is dead. ~mark -Original Message- From: Vicky [mailto:[EMAIL PROTECTED] Sent: Thursday, June 23, 2005 2:48 PM But having different actions in struts-config. how would I call them in my jsp html:form ? because right now I have only one action in jsp and then for each button i have property="method".. in jsp in struts-config for this action mapping I have parameter="method" Did I miss anything in here? This email and any file transmitted with it may be confidential and is intended solely for the use of the individual or entity to whom it is addressed. If you received this email in error please notify the DBM Service Desk by forwarding this message to [EMAIL PROTECTED] This email has been scanned by networkMaryland Antivirus Service for the presence of computer viruses. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation while using LookupDispatchAction
Wendy, But having different actions in struts-config. how would I call them in my jsp html:form ? because right now I have only one action in jsp and then for each button i have property="method".. in jsp in struts-config for this action mapping I have parameter="method" Did I miss anything in here? Thanks, --- Wendy Smoak <[EMAIL PROTECTED]> wrote: > From: "Vicky" <[EMAIL PROTECTED]> > > > My action class extends LookupDispatchAction, > which > > has different methods in it. In struts-config.xml > i > > have parameter method as we all know. My problem > is; > > in my validation.xml i do have to perform > different > > validations for different methods, how do I > > distinguish or find out which method is called to > > perform validation for that method only? > > Because you're using DynaValidator_Action_Form, the > framework will match up > the 'path' attribute from struts-config.xml > with the 'name' > attribute from validation.xml. > > I do it by having different URL patterns mapped to > the same > LookupDispatchAction using the same > DynaValidatorActionForm. > > In the tag, only the 'path' and 'input' > differ (so > 'getInputForward()' works, no matter which path you > came in with, you go to > the right form-- it's a four-step wizard.) > path="/denRegister" > type="edu.example.RegisterAction" > name="registerForm" ... > input="den.register.step1"> ... > path="/denRegister3" > type="edu.example.RegisterAction" > name="registerForm" ... > input="den.register.step3"> ... > > Then in validation.xml, you use the path for the > form "name" (which is > slightly confusing...): > ... > ... > > And then you can have different fields validated for > different paths, even > though it's the same Action and the same Form. All > my forms are POSTed, so > I wouldn't have had ?parameter=someText in any case. > > HTH, > -- > Wendy Smoak > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > Yahoo! Sports Rekindle the Rivalries. Sign up for Fantasy Football http://football.fantasysports.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validation while using LookupDispatchAction
I would probably use ValidWhen test ( (method!= "validateMe") or (*this* != null) ) Thanks and Regards, Nitish Kumar -Original Message- From: Vicky [mailto:[EMAIL PROTECTED] Sent: Thursday, June 23, 2005 7:55 PM To: Struts Users Mailing List Subject: Validation while using LookupDispatchAction My action class extends LookupDispatchAction, which has different methods in it. In struts-config.xml i have parameter method as we all know. My problem is; in my validation.xml i do have to perform different validations for different methods, how do I distinguish or find out which method is called to perform validation for that method only? struts-config.xml validation.xml in above code in validaton.xml i need to pass method name for which i want this validation to take place not for all methods. Something like how do I do this? or any other way. I would appreciate prompt response with examples. Thanks in advance, __ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail - 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]
Re: Validation while using LookupDispatchAction
From: "Vicky" <[EMAIL PROTECTED]> > My action class extends LookupDispatchAction, which > has different methods in it. In struts-config.xml i > have parameter method as we all know. My problem is; > in my validation.xml i do have to perform different > validations for different methods, how do I > distinguish or find out which method is called to > perform validation for that method only? Because you're using DynaValidator_Action_Form, the framework will match up the 'path' attribute from struts-config.xml with the 'name' attribute from validation.xml. I do it by having different URL patterns mapped to the same LookupDispatchAction using the same DynaValidatorActionForm. In the tag, only the 'path' and 'input' differ (so 'getInputForward()' works, no matter which path you came in with, you go to the right form-- it's a four-step wizard.) ... ... Then in validation.xml, you use the path for the form "name" (which is slightly confusing...): ... ... And then you can have different fields validated for different paths, even though it's the same Action and the same Form. All my forms are POSTed, so I wouldn't have had ?parameter=someText in any case. HTH, -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validation while using LookupDispatchAction
My action class extends LookupDispatchAction, which has different methods in it. In struts-config.xml i have parameter method as we all know. My problem is; in my validation.xml i do have to perform different validations for different methods, how do I distinguish or find out which method is called to perform validation for that method only? struts-config.xml validation.xml in above code in validaton.xml i need to pass method name for which i want this validation to take place not for all methods. Something like how do I do this? or any other way. I would appreciate prompt response with examples. Thanks in advance, __ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]