Re: Validation question:not required but still needs to be validated if entered
I think, you have to implement your own validator. Let is inherent from the original validator and overwrite the appropiate method. Than you can skip the validation if the field was empty. Sven Shah, Shrihas (OFT) wrote: Hi : I have a date field and it is not a required field. If somebody enters the value then It has to be valid date though. How should I do it? I have removed required flag in my validation.xml but it still says required. My validation.xml entry looks like depends="date"> datePatternStrict MM/dd/ I removed required flag but it still stays required. Thanks Shrihas. //Shrihas Shah/// //NYS Office for Technology// //[EMAIL PROTECTED]// //Phone (518) 408-2382// //Fax (518) 473-3389// //(US Postal Service Regular Mail Address)// //State Capitol ESP, PO Box 2062// //Albany, NY 12220-0062// //(Parcel Post/Overnight and Interagency Mail Address)// //Empire State Plaza// //Swan St., Core 4, 1st Floor// //Albany, NY 12223/// - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why cancel throw Action.execute ?
You are right. The form is populated, but the validation is skipped. Your action has now to check Action#isCanceled. I think some of the higher Action implementations do this. Sven Niall Pemberton wrote: I believe this is incorrect. The form should still be populated, but the "validation" is skipped. Niall - Original Message - From: "James Mitchell" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, May 10, 2004 1:01 PM Subject: Re: Why cancel throw Action.execute ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic tag
[EMAIL PROTECTED] wrote: I am new to struts. I have a question regarding logic tag. I was replacing those if else if . end if stuffs with logic tags on jsp pages. For example: if num==1 {// condition 1 block 1; }else if num==2 {// condition 2 block 2; } Usually if condition 1 is true, condition 2 does not be evaluated. Now if I use tag as follows: (condition 1) block 1; (condition 2) block 2; It seems that condition 2 is always evaluated no matter what the result of condition 1 is. It would be a performance penalty if this is the case. Am I wrong? Thanks for help, Kathy Thats because of the jsp custom tag specification, that does not allow data sharing between blocks. Sven - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DynaValidatorForm in struts
Zhang, Larry (L.) wrote: When using DynaValidatorForm, you just put the fields in the struts configuration xml file, and you don't need a formbean to set all the fields manually, which in turn saves your developing time. I am asking in struts community, is there any reason/encouragement for not using DynaValidatorForm? Thanks. Larry Zhang - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] I think, there are several converting problems when you use types other than String Sven - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Overriding RequestProcessor for sesion validationi
GMaine wrote: Hi. I wonder if someone can help me. I'm trying to override RequestProcessor to check whether a user has logged in. If he has, I'll let the request proceed. If not, I'd like to forward him somewhere. The problem is, I need to display an error message if I'm redirecting the user. I'm trying to use standard Struts classes like ActionErrors. But RequestProcessor doesn't have access to the Action.saveErrors method. Is there another way to put ActionErrors into the response? Or am I going about this the wrong way? Thanks, Jacob Just take a look at the source of the saveErrors method. You will see that it just stores the ActionErrors into the request using the key Globals.ERRORS_KEY. Sven - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]