RE: Struts Validator and Select boxes
Hi Niall, I am attaching the validation.xml and the jsp that i have used. I have done the exact thing that you had specified earlier before posting to the mailing list. I am not clear where i am going wrong. The Struts-config entry goes like - Regards, Janarthan S -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Friday, March 26, 2004 8:55 PM To: Struts Users Mailing List Subject: Re: Struts Validator and Select boxes Posting whats in your validation.xml for the form and the bit of your jsp with your select fields would be helpfull. If you take the "fromDay" as an example, you are using field.getVarValue("fromDay") - if you don't have a "var" defined in your validation.xml for "fromDay" then that would cause the "No Name Specified" error - same goes for "fromYear", "toMonth", "toDay" and "toYear". As for getting nulls, looks to me again that whats specified for the "vars" in your validation.xml doesn't tie up with the names specified on your form. >From your code I would expect something like the following in your validation.xml fromDay formFromDay fromYear formFromYear toMonth formToMonth toDay formToDay toYear formToYear Do you have the properties in your form correct (i.e in this example formFromDay, formFromYear, formToMonth, formToDay, formToYear). Niall - Original Message - From: "Janarthan Sathiamurthy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, March 25, 2004 4:46 PM Subject: Struts Validator and Select boxes Hi, I am using Struts validator. One page of mine has dates displayed as "MM" "DD" "". All the above 3 are displayed in seprate combo/select boxes. I need to do some custom validations on these fields. I wrote a custom class for the same Looks like - public static boolean validateDates(Object bean, ValidatorAction validatorAction, Field field, ActionErrors errors, HttpServletRequest request) { String actionType = ValidatorUtil.getValueAsString(bean, field.getVarValue("actionType")); // A hidden form field String fromMonth = ValidatorUtil.getValueAsString(bean, field.getProperty()); String fromDay = ValidatorUtil.getValueAsString(bean, field.getVarValue("fromDay")); String fromYear = ValidatorUtil.getValueAsString(bean, field.getVarValue("fromYear")); String toMonth = ValidatorUtil.getValueAsString(bean, field.getVarValue("toMonth")); String toDay = ValidatorUtil.getValueAsString(bean, field.getVarValue("toDay")); String toYear = ValidatorUtil.getValueAsString(bean, field.getVarValue("toYear")); System.out.println("actionType " + actionType); System.out.println("fromMonth " + fromMonth); System.out.println("fromDay " + fromDay); System.out.println("fromYear " + fromYear); System.out.println("toMonth " + toMonth); System.out.println("toDay " + toDay); System.out.println("toYear " + toYear); return true; } O/P of the above code - actionType searchPage fromMonth 2 fromDay null fromYear null toMonth null toDay null toYear null It also gives me "No Name Specified error". Point to note is that the all other fields other than 'actionType' are select boxes. It gives a null for all the field types that are of html:select. Is this a known BUG or am i going wrong somewhere ? Error LOG - Mar 25, 2004 9:53:11 PM org.apache.commons.validator.ValidatorUtil getValueAsString SEVERE: No name specified java.lang.IllegalArgumentException: No name specified at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.j ava:721) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:80 1) at org.apache.commons.validator.ValidatorUtil.getValueAsString(ValidatorUtil.ja va:121) at com.mot.servicetools.util.OCSReportsDateValidator.validateDates(OCSReportsDa teValidator.j ava:55) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
Re: Struts Validator and Select boxes
Posting whats in your validation.xml for the form and the bit of your jsp with your select fields would be helpfull. If you take the "fromDay" as an example, you are using field.getVarValue("fromDay") - if you don't have a "var" defined in your validation.xml for "fromDay" then that would cause the "No Name Specified" error - same goes for "fromYear", "toMonth", "toDay" and "toYear". As for getting nulls, looks to me again that whats specified for the "vars" in your validation.xml doesn't tie up with the names specified on your form. >From your code I would expect something like the following in your validation.xml fromDay formFromDay fromYear formFromYear toMonth formToMonth toDay formToDay toYear formToYear Do you have the properties in your form correct (i.e in this example formFromDay, formFromYear, formToMonth, formToDay, formToYear). Niall - Original Message - From: "Janarthan Sathiamurthy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, March 25, 2004 4:46 PM Subject: Struts Validator and Select boxes Hi, I am using Struts validator. One page of mine has dates displayed as "MM" "DD" "". All the above 3 are displayed in seprate combo/select boxes. I need to do some custom validations on these fields. I wrote a custom class for the same Looks like - public static boolean validateDates(Object bean, ValidatorAction validatorAction, Field field, ActionErrors errors, HttpServletRequest request) { String actionType = ValidatorUtil.getValueAsString(bean, field.getVarValue("actionType")); // A hidden form field String fromMonth = ValidatorUtil.getValueAsString(bean, field.getProperty()); String fromDay = ValidatorUtil.getValueAsString(bean, field.getVarValue("fromDay")); String fromYear = ValidatorUtil.getValueAsString(bean, field.getVarValue("fromYear")); String toMonth = ValidatorUtil.getValueAsString(bean, field.getVarValue("toMonth")); String toDay = ValidatorUtil.getValueAsString(bean, field.getVarValue("toDay")); String toYear = ValidatorUtil.getValueAsString(bean, field.getVarValue("toYear")); System.out.println("actionType " + actionType); System.out.println("fromMonth " + fromMonth); System.out.println("fromDay " + fromDay); System.out.println("fromYear " + fromYear); System.out.println("toMonth " + toMonth); System.out.println("toDay " + toDay); System.out.println("toYear " + toYear); return true; } O/P of the above code - actionType searchPage fromMonth 2 fromDay null fromYear null toMonth null toDay null toYear null It also gives me "No Name Specified error". Point to note is that the all other fields other than 'actionType' are select boxes. It gives a null for all the field types that are of html:select. Is this a known BUG or am i going wrong somewhere ? Error LOG - Mar 25, 2004 9:53:11 PM org.apache.commons.validator.ValidatorUtil getValueAsString SEVERE: No name specified java.lang.IllegalArgumentException: No name specified at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.j ava:721) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:80 1) at org.apache.commons.validator.ValidatorUtil.getValueAsString(ValidatorUtil.ja va:121) at com.mot.servicetools.util.OCSReportsDateValidator.validateDates(OCSReportsDa teValidator.j ava:55) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.validator.Validator.validateFieldForRule(Validator.java:4 54) at org.apache.commons.validator.Validator.validateField(Validator.java:544) at org.apache.commons.validator.Validator.validate(Validator.java:582) at org.apache.struts.validator.DynaValidatorActionForm.validate(DynaValidatorAc tionForm.java :125) at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.j ava:942) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255) at org.apache.struts.action.ActionServlet.process(ActionServlet.j
Any Takers ?RE: Struts Validator and Select boxes
Any help/takers ? -Original Message- From: Janarthan Sathiamurthy Sent: Thursday, March 25, 2004 10:16 PM To: [EMAIL PROTECTED] Subject: Struts Validator and Select boxes Hi, I am using Struts validator. One page of mine has dates displayed as "MM" "DD" "". All the above 3 are displayed in seprate combo/select boxes. I need to do some custom validations on these fields. I wrote a custom class for the same Looks like - public static boolean validateDates(Object bean, ValidatorAction validatorAction, Field field, ActionErrors errors, HttpServletRequest request) { String actionType = ValidatorUtil.getValueAsString(bean, field.getVarValue("actionType")); // A hidden form field String fromMonth = ValidatorUtil.getValueAsString(bean, field.getProperty()); String fromDay = ValidatorUtil.getValueAsString(bean, field.getVarValue("fromDay")); String fromYear = ValidatorUtil.getValueAsString(bean, field.getVarValue("fromYear")); String toMonth = ValidatorUtil.getValueAsString(bean, field.getVarValue("toMonth")); String toDay = ValidatorUtil.getValueAsString(bean, field.getVarValue("toDay")); String toYear = ValidatorUtil.getValueAsString(bean, field.getVarValue("toYear")); System.out.println("actionType " + actionType); System.out.println("fromMonth " + fromMonth); System.out.println("fromDay " + fromDay); System.out.println("fromYear " + fromYear); System.out.println("toMonth " + toMonth); System.out.println("toDay " + toDay); System.out.println("toYear " + toYear); return true; } O/P of the above code - actionType searchPage fromMonth 2 fromDay null fromYear null toMonth null toDay null toYear null It also gives me "No Name Specified error". Point to note is that the all other fields other than 'actionType' are select boxes. It gives a null for all the field types that are of html:select. Is this a known BUG or am i going wrong somewhere ? Error LOG - Mar 25, 2004 9:53:11 PM org.apache.commons.validator.ValidatorUtil getValueAsString SEVERE: No name specified java.lang.IllegalArgumentException: No name specified at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:721) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801) at org.apache.commons.validator.ValidatorUtil.getValueAsString(ValidatorUtil.java:121) at com.mot.servicetools.util.OCSReportsDateValidator.validateDates(OCSReportsDateValidator.j ava:55) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.validator.Validator.validateFieldForRule(Validator.java:454) at org.apache.commons.validator.Validator.validateField(Validator.java:544) at org.apache.commons.validator.Validator.validate(Validator.java:582) at org.apache.struts.validator.DynaValidatorActionForm.validate(DynaValidatorActionForm.java :125) at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:942) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.jav a:1053) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletC ontext.java:6310) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317) at weblogic.s
Struts Validator and Select boxes
Hi, I am using Struts validator. One page of mine has dates displayed as "MM" "DD" "". All the above 3 are displayed in seprate combo/select boxes. I need to do some custom validations on these fields. I wrote a custom class for the same Looks like - public static boolean validateDates(Object bean, ValidatorAction validatorAction, Field field, ActionErrors errors, HttpServletRequest request) { String actionType = ValidatorUtil.getValueAsString(bean, field.getVarValue("actionType")); // A hidden form field String fromMonth = ValidatorUtil.getValueAsString(bean, field.getProperty()); String fromDay = ValidatorUtil.getValueAsString(bean, field.getVarValue("fromDay")); String fromYear = ValidatorUtil.getValueAsString(bean, field.getVarValue("fromYear")); String toMonth = ValidatorUtil.getValueAsString(bean, field.getVarValue("toMonth")); String toDay = ValidatorUtil.getValueAsString(bean, field.getVarValue("toDay")); String toYear = ValidatorUtil.getValueAsString(bean, field.getVarValue("toYear")); System.out.println("actionType " + actionType); System.out.println("fromMonth " + fromMonth); System.out.println("fromDay " + fromDay); System.out.println("fromYear " + fromYear); System.out.println("toMonth " + toMonth); System.out.println("toDay " + toDay); System.out.println("toYear " + toYear); return true; } O/P of the above code - actionType searchPage fromMonth 2 fromDay null fromYear null toMonth null toDay null toYear null It also gives me "No Name Specified error". Point to note is that the all other fields other than 'actionType' are select boxes. It gives a null for all the field types that are of html:select. Is this a known BUG or am i going wrong somewhere ? Error LOG - Mar 25, 2004 9:53:11 PM org.apache.commons.validator.ValidatorUtil getValueAsString SEVERE: No name specified java.lang.IllegalArgumentException: No name specified at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:721) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801) at org.apache.commons.validator.ValidatorUtil.getValueAsString(ValidatorUtil.java:121) at com.mot.servicetools.util.OCSReportsDateValidator.validateDates(OCSReportsDateValidator.j ava:55) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.validator.Validator.validateFieldForRule(Validator.java:454) at org.apache.commons.validator.Validator.validateField(Validator.java:544) at org.apache.commons.validator.Validator.validate(Validator.java:582) at org.apache.struts.validator.DynaValidatorActionForm.validate(DynaValidatorActionForm.java :125) at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:942) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.jav a:1053) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletC ontext.java:6310) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:36 22) at weblogic.servlet.internal.ServletReques
RE: Struts validator Regular Expressions
Hi, This is a good one to get started - http://weblogtoolscollection.com/regex/regex.php Best Regards, Janarthan S -Original Message- From: Joao Batistella [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 12:03 AM To: 'Struts Users Mailing List' Subject: Struts validator Regular Expressions Hello! Do you know any document where can I learn how to build regular expressions for Struts Validator? I need to validate an IP address and I don't know how is the syntax in the validator config file. Thanks, JP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts validator Regular Expressions
Validator does use ORO - There is an applet you can play with to test your regexp: http://jakarta.apache.org/oro/demo.html Choose the "contains" option and start/end your regular expressions with ^ and $ Niall - Original Message - From: "Takhar, Sandeep" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, March 24, 2004 6:52 PM Subject: RE: Struts validator Regular Expressions don't quote me but the javadocs for jakarta's regular expression's RE class are ok. Also I believe everything is based on jakarta's oro. sandeep -Original Message- From: Joao Batistella [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 1:33 PM To: 'Struts Users Mailing List' Subject: Struts validator Regular Expressions Hello! Do you know any document where can I learn how to build regular expressions for Struts Validator? I need to validate an IP address and I don't know how is the syntax in the validator config file. Thanks, JP - 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: Struts validator Regular Expressions
Hi, this should be very close to \d{1,3}[.]\d{1,3}[.]\d{1,3}[.]\d{1,3} I need to validate an IP address and I don't know how is the syntax in the validator config file. take your time to study this: http://java.sun.com/docs/books/tutorial/extra/regex/ It's worth the trouble, regex rox ! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts validator Regular Expressions
don't quote me but the javadocs for jakarta's regular expression's RE class are ok. Also I believe everything is based on jakarta's oro. sandeep -Original Message- From: Joao Batistella [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 1:33 PM To: 'Struts Users Mailing List' Subject: Struts validator Regular Expressions Hello! Do you know any document where can I learn how to build regular expressions for Struts Validator? I need to validate an IP address and I don't know how is the syntax in the validator config file. Thanks, JP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts validator Regular Expressions
Hello! Do you know any document where can I learn how to build regular expressions for Struts Validator? I need to validate an IP address and I don't know how is the syntax in the validator config file. Thanks, JP
Re: Struts Validator
Whats missing from your question is how are you identifying which "client" a user belongs to? Niall - Original Message - From: "Matthew Clark" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 22, 2004 12:09 PM Subject: Struts Validator Hi there, I am new to Struts and this mailing list but by no means new to Java. I have been reading the "Struts in Action" book and taken a quick look at the API etc and have a simple question regarding the Validator in my environment. We are an Application Service Provider and serve well over 1000 clients (who in turn each have between 5 and 1000 end users using the system). Although each client uses the same core application, they can have very different views of data and input forms and may have very different validation requirements. Is it possible to specify validation config at runtime when using the struts validator? So each of our clients could have a configuration file that specified which validation XML file to use for a given input form? We could use a different form for each user but that would be inefficient and a maintenance nightmare.. I want to call the same form/servlet but have it display a different look & feel and have different validation rules client side and server side. At the moment, the validation is very much tied to the presentation layer and I want to decouple it. This is really the last obstacle standing in the way of our migration to a pure java solution using Struts.. The use of the validator would simplify our solution a great deal and I will also be looking into the possibility of our clients creating their own validation configuration files (using a web interface of some sort) any help or advice would be appreciated. Regards, Matthew - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Validator
Hi there, I am new to Struts and this mailing list but by no means new to Java. I have been reading the "Struts in Action" book and taken a quick look at the API etc and have a simple question regarding the Validator in my environment. We are an Application Service Provider and serve well over 1000 clients (who in turn each have between 5 and 1000 end users using the system). Although each client uses the same core application, they can have very different views of data and input forms and may have very different validation requirements. Is it possible to specify validation config at runtime when using the struts validator? So each of our clients could have a configuration file that specified which validation XML file to use for a given input form? We could use a different form for each user but that would be inefficient and a maintenance nightmare.. I want to call the same form/servlet but have it display a different look & feel and have different validation rules client side and server side. At the moment, the validation is very much tied to the presentation layer and I want to decouple it. This is really the last obstacle standing in the way of our migration to a pure java solution using Struts.. The use of the validator would simplify our solution a great deal and I will also be looking into the possibility of our clients creating their own validation configuration files (using a web interface of some sort) any help or advice would be appreciated. Regards, Matthew
Re: Map-backed Forms and Struts Validator
Hi Derek, from the ppt doc, it looks like validWhen is using a syntax that is designed for checking indexed properties. I haven't used it though. I assume that it would handle nested beans as well, in accordance with the rest of the action form functionality. But again, I don't know. Also it says you can't use validWhen until you upgrade to struts 1.2 or a nightly build. I admit, it doesn't look hopeful. Have you tried a simple test case using the syntax like in the ppt doc? Adam On 03/18/2004 12:56 AM Derek Richardson wrote: Read through the various Struts validator docs and the map-backed form faq but didn't see this. James Turner's "Indexed Properties and Validation" presentation (http://www.strutskickstart.com/IndexedPropertiesandValidation.ppt) came close, but still not explicit enough for me to figure out. :( Struts 1.1. Uses Commons Validator 1.0.2. Is it possible to use the Struts validator to validate beans stored in a map-backed form? If so, does anyone have an example at-hand to send me? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [SOLVED] Struts Validator prints all javascript functions
Whoops . that didn't quite solve the problem . the real javascript methods are not quite being appended to the response . My apologies! -Original Message- From: Kunal H. Parikh [mailto:[EMAIL PROTECTED] Sent: Thursday, 18 March 2004 12:11 To: 'Struts Users Mailing List' Cc: 'Joe Germuska'; 'Theodosios Paschalidis' Subject: RE: [SOLVED] Struts Validator prints all javascript functions Hi All! After some debugging, I worked out that there are two variables "dynamicJavaScript" and "staticJavaScript" in the JavascriptValidatorTag class. By default, their values are "true". And Hence, the staticJavaScript also gets included in the response. i.e. to only display relevant JS methods, your tag should look like, cheers, kunal -Original Message- From: Kunal H. Parikh [mailto:[EMAIL PROTECTED] Sent: Monday, 15 March 2004 08:55 To: 'Struts Users Mailing List' Subject: Struts Validator prints all javascript functions Hi All! I am attempting to use Struts Validator. All works well, but I am only using the "required" validation in my code. However, the JavaScript that gets generated, include other functions like checkEmail, minLength, etc. etc. Is this expected behaviour? My code (FYI): === : == TIA, Kunal - 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]
RE: [SOLVED] Struts Validator prints all javascript functions
Hi All! After some debugging, I worked out that there are two variables "dynamicJavaScript" and "staticJavaScript" in the JavascriptValidatorTag class. By default, their values are "true". And Hence, the staticJavaScript also gets included in the response. i.e. to only display relevant JS methods, your tag should look like, cheers, kunal -Original Message- From: Kunal H. Parikh [mailto:[EMAIL PROTECTED] Sent: Monday, 15 March 2004 08:55 To: 'Struts Users Mailing List' Subject: Struts Validator prints all javascript functions Hi All! I am attempting to use Struts Validator. All works well, but I am only using the "required" validation in my code. However, the JavaScript that gets generated, include other functions like checkEmail, minLength, etc. etc. Is this expected behaviour? My code (FYI): === : == TIA, Kunal - 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]
Map-backed Forms and Struts Validator
Read through the various Struts validator docs and the map-backed form faq but didn't see this. James Turner's "Indexed Properties and Validation" presentation (http://www.strutskickstart.com/IndexedPropertiesandValidation.ppt) came close, but still not explicit enough for me to figure out. :( Struts 1.1. Uses Commons Validator 1.0.2. Is it possible to use the Struts validator to validate beans stored in a map-backed form? If so, does anyone have an example at-hand to send me? Thanks, Derek Richardson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts Validator prints all javascript functions
Hi Kunal, I do not use Tiles nor the DynaValidator but I get the same in a certain Form. I use Struts 1.1 Theo - Original Message - From: "Kunal H. Parikh" <[EMAIL PROTECTED]> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]> Sent: Monday, March 15, 2004 9:38 PM Subject: RE: Struts Validator prints all javascript functions Hi Guys ! Does anyone think that this could be happening because I am using Tiles ? Kunal -Original Message- From: Kunal H. Parikh [mailto:[EMAIL PROTECTED] Sent: Monday, 15 March 2004 10:12 To: 'Struts Users Mailing List' Subject: RE: Struts Validator prints all javascript functions I thought so too! My struts-config.xml reads as follows == .. .. = Do you think DynaValidatorActionForm could be creating the problem ? Kunal -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Marino A. Jonsson Sent: Monday, 15 March 2004 10:07 To: [EMAIL PROTECTED] Subject: Re: Struts Validator prints all javascript functions hmm ... that's not my experience - the dynamic parts are rendered as they should, but all the static javascript is then rendered too (instead of just the relevant static methods). I haven't tested 1.2 though. Marino "Joe Germuska" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > At 8:55 AM +1100 3/15/04, Kunal H. Parikh wrote: > >Hi All! > > > >I am attempting to use Struts Validator. > > > >All works well, but I am only using the "required" validation in my code. > > > >However, the JavaScript that gets generated, include other functions like > >checkEmail, minLength, etc. etc. > > > >Is this expected behaviour? > > This is what happens when the "formName" you specify in the > html:javascript tag is not found by the validator. > > Since Struts 1.2.0 (and a little before in the nightlies, of course), > this condition causes a JSPException to be thrown instead. > > Joe > > > -- > Joe Germuska > [EMAIL PROTECTED] > http://blog.germuska.com >"Imagine if every Thursday your shoes exploded if you tied them > the usual way. This happens to us all the time with computers, and > nobody thinks of complaining." > -- Jef Raskin - 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]
RE: Struts Validator prints all javascript functions
Hi Guys ! Does anyone think that this could be happening because I am using Tiles ? Kunal -Original Message- From: Kunal H. Parikh [mailto:[EMAIL PROTECTED] Sent: Monday, 15 March 2004 10:12 To: 'Struts Users Mailing List' Subject: RE: Struts Validator prints all javascript functions I thought so too! My struts-config.xml reads as follows == ... ... = Do you think DynaValidatorActionForm could be creating the problem ? Kunal -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Marino A. Jonsson Sent: Monday, 15 March 2004 10:07 To: [EMAIL PROTECTED] Subject: Re: Struts Validator prints all javascript functions hmm ... that's not my experience - the dynamic parts are rendered as they should, but all the static javascript is then rendered too (instead of just the relevant static methods). I haven't tested 1.2 though. Marino "Joe Germuska" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > At 8:55 AM +1100 3/15/04, Kunal H. Parikh wrote: > >Hi All! > > > >I am attempting to use Struts Validator. > > > >All works well, but I am only using the "required" validation in my code. > > > >However, the JavaScript that gets generated, include other functions like > >checkEmail, minLength, etc. etc. > > > >Is this expected behaviour? > > This is what happens when the "formName" you specify in the > html:javascript tag is not found by the validator. > > Since Struts 1.2.0 (and a little before in the nightlies, of course), > this condition causes a JSPException to be thrown instead. > > Joe > > > -- > Joe Germuska > [EMAIL PROTECTED] > http://blog.germuska.com >"Imagine if every Thursday your shoes exploded if you tied them > the usual way. This happens to us all the time with computers, and > nobody thinks of complaining." > -- Jef Raskin - 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]
RE: Struts Validator prints all javascript functions
I thought so too! My struts-config.xml reads as follows == ... ... = Do you think DynaValidatorActionForm could be creating the problem ? Kunal -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Marino A. Jonsson Sent: Monday, 15 March 2004 10:07 To: [EMAIL PROTECTED] Subject: Re: Struts Validator prints all javascript functions hmm ... that's not my experience - the dynamic parts are rendered as they should, but all the static javascript is then rendered too (instead of just the relevant static methods). I haven't tested 1.2 though. Marino "Joe Germuska" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > At 8:55 AM +1100 3/15/04, Kunal H. Parikh wrote: > >Hi All! > > > >I am attempting to use Struts Validator. > > > >All works well, but I am only using the "required" validation in my code. > > > >However, the JavaScript that gets generated, include other functions like > >checkEmail, minLength, etc. etc. > > > >Is this expected behaviour? > > This is what happens when the "formName" you specify in the > html:javascript tag is not found by the validator. > > Since Struts 1.2.0 (and a little before in the nightlies, of course), > this condition causes a JSPException to be thrown instead. > > Joe > > > -- > Joe Germuska > [EMAIL PROTECTED] > http://blog.germuska.com >"Imagine if every Thursday your shoes exploded if you tied them > the usual way. This happens to us all the time with computers, and > nobody thinks of complaining." > -- Jef Raskin - 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: Struts Validator prints all javascript functions
hmm ... that's not my experience - the dynamic parts are rendered as they should, but all the static javascript is then rendered too (instead of just the relevant static methods). I haven't tested 1.2 though. Marino "Joe Germuska" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > At 8:55 AM +1100 3/15/04, Kunal H. Parikh wrote: > >Hi All! > > > >I am attempting to use Struts Validator. > > > >All works well, but I am only using the "required" validation in my code. > > > >However, the JavaScript that gets generated, include other functions like > >checkEmail, minLength, etc. etc. > > > >Is this expected behaviour? > > This is what happens when the "formName" you specify in the > html:javascript tag is not found by the validator. > > Since Struts 1.2.0 (and a little before in the nightlies, of course), > this condition causes a JSPException to be thrown instead. > > Joe > > > -- > Joe Germuska > [EMAIL PROTECTED] > http://blog.germuska.com >"Imagine if every Thursday your shoes exploded if you tied them > the usual way. This happens to us all the time with computers, and > nobody thinks of complaining." > -- Jef Raskin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts Validator prints all javascript functions
At 8:55 AM +1100 3/15/04, Kunal H. Parikh wrote: Hi All! I am attempting to use Struts Validator. All works well, but I am only using the "required" validation in my code. However, the JavaScript that gets generated, include other functions like checkEmail, minLength, etc. etc. Is this expected behaviour? This is what happens when the "formName" you specify in the html:javascript tag is not found by the validator. Since Struts 1.2.0 (and a little before in the nightlies, of course), this condition causes a JSPException to be thrown instead. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining." -- Jef Raskin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Validator prints all javascript functions
Hi All! I am attempting to use Struts Validator. All works well, but I am only using the "required" validation in my code. However, the JavaScript that gets generated, include other functions like checkEmail, minLength, etc. etc. Is this expected behaviour? My code (FYI): === : == TIA, Kunal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts Validator
They are in two places, the struts specific validator files are in the struts.jar - but validator is a commons component and its class files are in commons-validator.jar. Everything is shipped with the struts binary - look in the lib folder. - Original Message - From: "Ramachandran" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, March 08, 2004 9:43 AM Subject: Struts Validator > Can any one please send me the URL of where struts validator files are. I > want to use the validator in my project. So i am in the need pf such class > files... > > Thanx, > Ram > > > - > 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]
Struts Validator
Can any one please send me the URL of where struts validator files are. I want to use the validator in my project. So i am in the need pf such class files... Thanx, Ram - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts logic combined with the struts validator
is there anyone on this list who writes his own validators ? - Original Message - From: "Alexander Craen" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Tuesday, March 02, 2004 11:41 PM Subject: Re: Struts logic combined with the struts validator > I`ve been looking some more into the case and I think its becoming more of a > design matter... > > I dont know if I am using struts the right way or not. > Problem is that I am building business logic into my forms.. Is this good or > not? > > > > > Should I make 2 different pages or use tiles or something completely else? > problem is that on the first page I ask 5 questions to the customer. Based > on their choices the second form is built up. all business related stuff... > > I tried to write a validator like requiredif but based on beans from > somewhere in your scope > struts logic can work on beans from your session or request scope because it > has streight access to the pagecontext > I dont find a way to really access my pageContext in the validator. > but do you want your validator actually reading from your request scope or > session scope? > > tnx for your time :) > > Alexander Craen > > > > - Original Message - > From: "Alexander Craen" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > Sent: Tuesday, March 02, 2004 3:38 PM > Subject: Re: Struts logic combined with the struts validator > > > > Well , > > > > I thought about this as well.. however I cannot put bogus information in > the > > fields because their 'NULL' value matters to the registration process > > > > I would have to filter on the bogus information... which I would not like > to > > do > > > > tnx > > > > Alexander Craen > > > > - Original Message - > > From: "Matt Bathje" <[EMAIL PROTECTED]> > > To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > > Sent: Tuesday, March 02, 2004 3:24 PM > > Subject: Re: Struts logic combined with the struts validator > > > > > > > Alexander - > > > > > > Usually when I have this situation I just put in an else (or a > > > logic:notEqual in your case) which prints out the form field as hidden > > with > > > some "bogus" data in it. That "bogus" data will be enough to make the > > > validation pass of course. > > > > > > I had thought about doing the requiredifpresent or something like that, > > but > > > this always seemed much simpler. > > > > > > Matt Bathje > > > > > > - Original Message - > > > From: "Alexander Craen" <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Tuesday, March 02, 2004 8:14 AM > > > Subject: Re: Struts logic combined with the struts validator > > > > > > > > > > Maybe i`ll better rephrase my question to make it more easy for the > > reader > > > > :) > > > > > > > > I want to make a field in a form required when it exists on the form > > > > > > > > if it is not on the form (due to some logic tags that make it > > disappear), > > > I > > > > dont want to generate an error. > > > > > > > > How would I best solve this? > > > > > > > > make a new validator "requiredifpresent" ? > > > > or could I use the requiredif together with some logic based on values > > in > > > > other beans ? > > > > > > > > > > > > - Original Message - > > > > From: "Alexander Craen" <[EMAIL PROTECTED]> > > > > To: <[EMAIL PROTECTED]> > > > > Sent: Tuesday, March 02, 2004 11:25 AM > > > > Subject: Struts logic combined with the struts validato > > > > > > > > > > > > > Hello, > > > > > I am making a registration procedure that works with some logic > based > > on > > > > the > > > > > choices the customer makes on a previous page > > > > > > > > > > scope="session" > > > > > value="business"> > > > > > > > > > key="text.data.label.bill_vat_number"/> > > > > > > > > > > > > > > > > > > > > Problem descriptio
Re: Struts logic combined with the struts validator
I`ve been looking some more into the case and I think its becoming more of a design matter... I dont know if I am using struts the right way or not. Problem is that I am building business logic into my forms.. Is this good or not? Should I make 2 different pages or use tiles or something completely else? problem is that on the first page I ask 5 questions to the customer. Based on their choices the second form is built up. all business related stuff... I tried to write a validator like requiredif but based on beans from somewhere in your scope struts logic can work on beans from your session or request scope because it has streight access to the pagecontext I dont find a way to really access my pageContext in the validator. but do you want your validator actually reading from your request scope or session scope? tnx for your time :) Alexander Craen - Original Message - From: "Alexander Craen" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Tuesday, March 02, 2004 3:38 PM Subject: Re: Struts logic combined with the struts validator > Well , > > I thought about this as well.. however I cannot put bogus information in the > fields because their 'NULL' value matters to the registration process > > I would have to filter on the bogus information... which I would not like to > do > > tnx > > Alexander Craen > > - Original Message - > From: "Matt Bathje" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > Sent: Tuesday, March 02, 2004 3:24 PM > Subject: Re: Struts logic combined with the struts validator > > > > Alexander - > > > > Usually when I have this situation I just put in an else (or a > > logic:notEqual in your case) which prints out the form field as hidden > with > > some "bogus" data in it. That "bogus" data will be enough to make the > > validation pass of course. > > > > I had thought about doing the requiredifpresent or something like that, > but > > this always seemed much simpler. > > > > Matt Bathje > > > > - Original Message - > > From: "Alexander Craen" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Tuesday, March 02, 2004 8:14 AM > > Subject: Re: Struts logic combined with the struts validator > > > > > > > Maybe i`ll better rephrase my question to make it more easy for the > reader > > > :) > > > > > > I want to make a field in a form required when it exists on the form > > > > > > if it is not on the form (due to some logic tags that make it > disappear), > > I > > > dont want to generate an error. > > > > > > How would I best solve this? > > > > > > make a new validator "requiredifpresent" ? > > > or could I use the requiredif together with some logic based on values > in > > > other beans ? > > > > > > > > > - Original Message - > > > From: "Alexander Craen" <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Tuesday, March 02, 2004 11:25 AM > > > Subject: Struts logic combined with the struts validato > > > > > > > > > > Hello, > > > > I am making a registration procedure that works with some logic based > on > > > the > > > > choices the customer makes on a previous page > > > > > > > > > > > value="business"> > > > > > > > key="text.data.label.bill_vat_number"/> > > > > > > > > > > > > > > > > Problem description : > > > > When a customer is of customertype 'business' the field bill_vat_nr is > > > > showed on the page and is required when a customer is not of > > customertype > > > > 'business' the field bill_vat_nr is not showed on the page and > theirfor > > is > > > > not required > > > > > > > > I tried to use a standard struts validator implementation > > > > > > > > > > > > > > > > > > > > > > > > I first thought about using the requiredif implementation. Problem is > > that > > > I > > > > only get it to work with elements from the same form. > > > > > > > > The result : > > > > The bill_vat_nr is required even if it has been left out of the form > by > > > > struts logic &g
Re: Struts logic combined with the struts validator
Well , I thought about this as well.. however I cannot put bogus information in the fields because their 'NULL' value matters to the registration process I would have to filter on the bogus information... which I would not like to do tnx Alexander Craen - Original Message - From: "Matt Bathje" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Tuesday, March 02, 2004 3:24 PM Subject: Re: Struts logic combined with the struts validator > Alexander - > > Usually when I have this situation I just put in an else (or a > logic:notEqual in your case) which prints out the form field as hidden with > some "bogus" data in it. That "bogus" data will be enough to make the > validation pass of course. > > I had thought about doing the requiredifpresent or something like that, but > this always seemed much simpler. > > Matt Bathje > > - Original Message - > From: "Alexander Craen" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, March 02, 2004 8:14 AM > Subject: Re: Struts logic combined with the struts validator > > > > Maybe i`ll better rephrase my question to make it more easy for the reader > > :) > > > > I want to make a field in a form required when it exists on the form > > > > if it is not on the form (due to some logic tags that make it disappear), > I > > dont want to generate an error. > > > > How would I best solve this? > > > > make a new validator "requiredifpresent" ? > > or could I use the requiredif together with some logic based on values in > > other beans ? > > > > > > - Original Message - > > From: "Alexander Craen" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Tuesday, March 02, 2004 11:25 AM > > Subject: Struts logic combined with the struts validato > > > > > > > Hello, > > > I am making a registration procedure that works with some logic based on > > the > > > choices the customer makes on a previous page > > > > > > > > value="business"> > > > > > key="text.data.label.bill_vat_number"/> > > > > > > > > > > > > Problem description : > > > When a customer is of customertype 'business' the field bill_vat_nr is > > > showed on the page and is required when a customer is not of > customertype > > > 'business' the field bill_vat_nr is not showed on the page and theirfor > is > > > not required > > > > > > I tried to use a standard struts validator implementation > > > > > > > > > > > > > > > > > > I first thought about using the requiredif implementation. Problem is > that > > I > > > only get it to work with elements from the same form. > > > > > > The result : > > > The bill_vat_nr is required even if it has been left out of the form by > > > struts logic > > > > > > My question : > > > Is their a way to combine struts logic and the validator framework? Do I > > > have to write a custom validator that does some kind of introspection on > > the > > > jsp? Or are their validators that are used for that purpose? What would > be > > > the best solution to tackle this problem? > > > > > > Tnx in advance > > > Alexander Craen > > > > > > > > > - > > > 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]
Re: Struts logic combined with the struts validator
Alexander - Usually when I have this situation I just put in an else (or a logic:notEqual in your case) which prints out the form field as hidden with some "bogus" data in it. That "bogus" data will be enough to make the validation pass of course. I had thought about doing the requiredifpresent or something like that, but this always seemed much simpler. Matt Bathje - Original Message - From: "Alexander Craen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 02, 2004 8:14 AM Subject: Re: Struts logic combined with the struts validator > Maybe i`ll better rephrase my question to make it more easy for the reader > :) > > I want to make a field in a form required when it exists on the form > > if it is not on the form (due to some logic tags that make it disappear), I > dont want to generate an error. > > How would I best solve this? > > make a new validator "requiredifpresent" ? > or could I use the requiredif together with some logic based on values in > other beans ? > > > - Original Message - > From: "Alexander Craen" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, March 02, 2004 11:25 AM > Subject: Struts logic combined with the struts validato > > > > Hello, > > I am making a registration procedure that works with some logic based on > the > > choices the customer makes on a previous page > > > > > value="business"> > > > key="text.data.label.bill_vat_number"/> > > > > > > > > Problem description : > > When a customer is of customertype 'business' the field bill_vat_nr is > > showed on the page and is required when a customer is not of customertype > > 'business' the field bill_vat_nr is not showed on the page and theirfor is > > not required > > > > I tried to use a standard struts validator implementation > > > > > > > > > > > > I first thought about using the requiredif implementation. Problem is that > I > > only get it to work with elements from the same form. > > > > The result : > > The bill_vat_nr is required even if it has been left out of the form by > > struts logic > > > > My question : > > Is their a way to combine struts logic and the validator framework? Do I > > have to write a custom validator that does some kind of introspection on > the > > jsp? Or are their validators that are used for that purpose? What would be > > the best solution to tackle this problem? > > > > Tnx in advance > > Alexander Craen > > > > > > - > > 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]
Re: Struts logic combined with the struts validator
Maybe i`ll better rephrase my question to make it more easy for the reader :) I want to make a field in a form required when it exists on the form if it is not on the form (due to some logic tags that make it disappear), I dont want to generate an error. How would I best solve this? make a new validator "requiredifpresent" ? or could I use the requiredif together with some logic based on values in other beans ? - Original Message - From: "Alexander Craen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 02, 2004 11:25 AM Subject: Struts logic combined with the struts validato > Hello, > I am making a registration procedure that works with some logic based on the > choices the customer makes on a previous page > > value="business"> > key="text.data.label.bill_vat_number"/> > > > > Problem description : > When a customer is of customertype 'business' the field bill_vat_nr is > showed on the page and is required when a customer is not of customertype > 'business' the field bill_vat_nr is not showed on the page and theirfor is > not required > > I tried to use a standard struts validator implementation > > > > > > I first thought about using the requiredif implementation. Problem is that I > only get it to work with elements from the same form. > > The result : > The bill_vat_nr is required even if it has been left out of the form by > struts logic > > My question : > Is their a way to combine struts logic and the validator framework? Do I > have to write a custom validator that does some kind of introspection on the > jsp? Or are their validators that are used for that purpose? What would be > the best solution to tackle this problem? > > Tnx in advance > Alexander Craen > > > - > 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: Struts Validator overriding cache-control?
Just to follow up with a few questions, based on the following statement: It is my assumption in this scenario that the browser (IE) has cached the URL and data posted to said URL, thus it is able to redisplay the page with the data the user has entered. 1. Is this a correct assumption? 2. If yes, is this the expected behaviour of a browser for pages that are marked as do not cache? 3. If yes, is there any known mechanism to force the browser to not cache the POST data? Cheers, James THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. > > -Original Message- > > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > > Sent: 2004 January 14 21.57 > > To: Struts Users Mailing List > > Subject: Re: Struts Validator overriding cache-control? > > > > > > The sequence you described is the expected behavior. > > Comments below. > > > > --- "Brown, James" <[EMAIL PROTECTED]> wrote: > > > We have encountered a situation wherein it appears that the > > server-side > > > validation provided by the struts-validator and that of > > > ValidatorForm.validate(...) appears to be overriding the > > controller's nocache > > > value. > > > > > > The scenario we have encountered is follows: > > > 1. user enters data on a page that is backed by a > > subclass of ValidatorForm > > > 2. form is submitted but one of either server-side > > validation for a required > > > field (set via the struts validator plugin) or the > > ValidatorForm.validate(...) > > > method returns and ActionError. > > My guess is the form was submitted using METHOD=POST. > > > 3. the page is redisplayed with the appropriate error > message(s). > > This page is the result of a submitted form. > > > 4. the user corrects the form and submits. > > > 5. the subsequent (success) page is displayed. > > > 6. the user selects the browser's back button and > > receives the IE "Warning: > > > Page has Expired" warning/error. > > When the user selects the back button, he is trying to > > redisplay the page shown > > in step 3, which can only be displayed by resubmitting the > > form. IE will not > > resubmit a form without informing the user, and therefore > > shows this warning to > > tell the user. > > > 7. the user refreshes the page via the F5 key or the > > refresh button, and the > > > page as displayed in step 3 is redisplayed. > > This is expected because the form that was submitted in step > > 2 was resubmitted by > > IE to display the page requested by the user. > > > > > > Our controller is set to not cache any pages via: > > > > > > > > > > > > > > > The ValidatorForm/ActionForm's scope is also set to > > request, thus the page > > > should be displayed empty. > > > > > > This situation only occurs if the form is submitted with > > data that fails > > > server-side validation and the page is redisplayed. In a > > true "success" path, > > > the page is displayed as desired - empty. > > > > > > Any ideas? > > > > Your user tried to redisplay the result of an errant form, > > and so WILL get the > > page with the error message. If you want to display an empty > > form, perhaps to > > allow the user to enter another set of data, you can provide > > a link which the > > user can follow for a fresh form, or display the form in step > > 5 along with your > > "success" message. > > > > > > > > Cheers, > > > James > > > > > > > > __ > > Do you Yahoo!? > > Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes > > http://hotjobs.sweepstakes.yahoo.com/signingbonus > > > > > - > > 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]
RE: Struts Validator overriding cache-control?
Thanks. I was confused by the fact that the behaviour is different if the page is submitted without error. In the without-error scenario, the "re-post" as the result of the refresh does not contain the form values that would logically be contained in the "with-error" scenario. Now, I just need to work myself out of the corner I am in - I need to prevent the refresh from redisplaying this data which I think is darn near imposibble. Cheers, James THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. > -Original Message- > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > Sent: 2004 January 14 21.57 > To: Struts Users Mailing List > Subject: Re: Struts Validator overriding cache-control? > > > The sequence you described is the expected behavior. > Comments below. > > --- "Brown, James" <[EMAIL PROTECTED]> wrote: > > We have encountered a situation wherein it appears that the > server-side > > validation provided by the struts-validator and that of > > ValidatorForm.validate(...) appears to be overriding the > controller's nocache > > value. > > > > The scenario we have encountered is follows: > > 1. user enters data on a page that is backed by a > subclass of ValidatorForm > > 2. form is submitted but one of either server-side > validation for a required > > field (set via the struts validator plugin) or the > ValidatorForm.validate(...) > > method returns and ActionError. > My guess is the form was submitted using METHOD=POST. > > 3. the page is redisplayed with the appropriate error message(s). > This page is the result of a submitted form. > > 4. the user corrects the form and submits. > > 5. the subsequent (success) page is displayed. > > 6. the user selects the browser's back button and > receives the IE "Warning: > > Page has Expired" warning/error. > When the user selects the back button, he is trying to > redisplay the page shown > in step 3, which can only be displayed by resubmitting the > form. IE will not > resubmit a form without informing the user, and therefore > shows this warning to > tell the user. > > 7. the user refreshes the page via the F5 key or the > refresh button, and the > > page as displayed in step 3 is redisplayed. > This is expected because the form that was submitted in step > 2 was resubmitted by > IE to display the page requested by the user. > > > > Our controller is set to not cache any pages via: > > > > > > > > > > The ValidatorForm/ActionForm's scope is also set to > request, thus the page > > should be displayed empty. > > > > This situation only occurs if the form is submitted with > data that fails > > server-side validation and the page is redisplayed. In a > true "success" path, > > the page is displayed as desired - empty. > > > > Any ideas? > > Your user tried to redisplay the result of an errant form, > and so WILL get the > page with the error message. If you want to display an empty > form, perhaps to > allow the user to enter another set of data, you can provide > a link which the > user can follow for a fresh form, or display the form in step > 5 along with your > "success" message. > > > > > Cheers, > > James > > > > __ > Do you Yahoo!? > Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes > http://hotjobs.sweepstakes.yahoo.com/signingbonus > > - > 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: Struts Validator overriding cache-control?
The sequence you described is the expected behavior. Comments below. --- "Brown, James" <[EMAIL PROTECTED]> wrote: > We have encountered a situation wherein it appears that the server-side > validation provided by the struts-validator and that of > ValidatorForm.validate(...) appears to be overriding the controller's nocache > value. > > The scenario we have encountered is follows: > 1. user enters data on a page that is backed by a subclass of ValidatorForm > 2. form is submitted but one of either server-side validation for a required > field (set via the struts validator plugin) or the ValidatorForm.validate(...) > method returns and ActionError. My guess is the form was submitted using METHOD=POST. > 3. the page is redisplayed with the appropriate error message(s). This page is the result of a submitted form. > 4. the user corrects the form and submits. > 5. the subsequent (success) page is displayed. > 6. the user selects the browser's back button and receives the IE "Warning: > Page has Expired" warning/error. When the user selects the back button, he is trying to redisplay the page shown in step 3, which can only be displayed by resubmitting the form. IE will not resubmit a form without informing the user, and therefore shows this warning to tell the user. > 7. the user refreshes the page via the F5 key or the refresh button, and the > page as displayed in step 3 is redisplayed. This is expected because the form that was submitted in step 2 was resubmitted by IE to display the page requested by the user. > > Our controller is set to not cache any pages via: > > > > > The ValidatorForm/ActionForm's scope is also set to request, thus the page > should be displayed empty. > > This situation only occurs if the form is submitted with data that fails > server-side validation and the page is redisplayed. In a true "success" path, > the page is displayed as desired - empty. > > Any ideas? Your user tried to redisplay the result of an errant form, and so WILL get the page with the error message. If you want to display an empty form, perhaps to allow the user to enter another set of data, you can provide a link which the user can follow for a fresh form, or display the form in step 5 along with your "success" message. > > Cheers, > James __ Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Validator overriding cache-control?
We have encountered a situation wherein it appears that the server-side validation provided by the struts-validator and that of ValidatorForm.validate(...) appears to be overriding the controller's nocache value. The scenario we have encountered is follows: 1. user enters data on a page that is backed by a subclass of ValidatorForm 2. form is submitted but one of either server-side validation for a required field (set via the struts validator plugin) or the ValidatorForm.validate(...) method returns and ActionError. 3. the page is redisplayed with the appropriate error message(s). 4. the user corrects the form and submits. 5. the subsequent (success) page is displayed. 6. the user selects the browser's back button and receives the IE "Warning: Page has Expired" warning/error. 7. the user refreshes the page via the F5 key or the refresh button, and the page as displayed in step 3 is redisplayed. Our controller is set to not cache any pages via: The ValidatorForm/ActionForm's scope is also set to request, thus the page should be displayed empty. This situation only occurs if the form is submitted with data that fails server-side validation and the page is redisplayed. In a true "success" path, the page is displayed as desired - empty. Any ideas? Cheers, James THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts validator framework
BDY.RTF Description: RTF file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts validator framework
ValidatorForm and ValidatorActionForm should be subclassed if you are not using dynamica forms and you want to leverage the Struts Validation framework. robert > -Original Message- > From: Jan Dirksen [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 16, 2003 11:51 AM > To: [EMAIL PROTECTED] > Subject: struts validator framework > > > hi, > just a question about using the validator-fw. > > i want to describe a formbean in struts-config > incl. its proberties. > > like: > > >type="java.lang.String"/> > > > for validation i want to use the framework > > > i guess: > -DynaValidatorForm: validation rules are executed > based on form name > > -DynaValidatorActionForm: validation rules are > executed based on action mapping > > > and what are the classes: > ValidatorForm > ValidatorActionForm > > for? > > > thanks > jan > > __ > > Gesendet von Yahoo! Mail - http://mail.yahoo.de > Logos und Klingeltöne fürs Handy bei http://sms.yahoo.de > > - > 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]
struts validator framework
hi, just a question about using the validator-fw. i want to describe a formbean in struts-config incl. its proberties. like: for validation i want to use the framework i guess: -DynaValidatorForm: validation rules are executed based on form name -DynaValidatorActionForm: validation rules are executed based on action mapping and what are the classes: ValidatorForm ValidatorActionForm for? thanks jan __ Gesendet von Yahoo! Mail - http://mail.yahoo.de Logos und Klingeltöne fürs Handy bei http://sms.yahoo.de - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Does the Struts Validator work with DynaActionForms?
Yes. You should use DynaValidatorForm or DynaValidatorActionForm. robert > -Original Message- > From: Anderson, James H [IT] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 16, 2003 9:21 AM > To: Struts Users Mailing List > Subject: Does the Struts Validator work with DynaActionForms? > > > I see that to setup server-side vaildations one must extend the > ValidatorForm or ValidatorActionForm class, but for dynamic form > support one must extend the DynaActionForm class... > > - > 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]
Does the Struts Validator work with DynaActionForms?
I see that to setup server-side vaildations one must extend the ValidatorForm or ValidatorActionForm class, but for dynamic form support one must extend the DynaActionForm class... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts validator with Date property ???
Change the type of date type to java.sql.Date you won't get that exception. This is because the Beanutils which they use to copy the data form request to form is not having a corresponding converter to convert to java.util.Date but it has a converter to convert to sql date Thanks Karuna -Original Message- From: Mauricio T. Ferraz [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 02, 2003 1:10 PM To: Struts Users Mailing List Subject: Struts validator with Date property ??? In my Form a hava a property java.util.Date, I can use the validator Struts? Or I just can have properties "Strings" ??? in my textfiels on form??? In the Struts' webapps has a example, the use only String to input of data... I got java.lang.IllegalArgumentException: argument type mismatch Thanks, for help. - 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]
Struts validator with Date property ???
In my Form a hava a property java.util.Date, I can use the validator Struts? Or I just can have properties "Strings" ??? in my textfiels on form??? In the Struts' webapps has a example, the use only String to input of data... I got java.lang.IllegalArgumentException: argument type mismatch Thanks, for help. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts-Validator & Websphere
BDY.RTF Description: RTF file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts-Validator & Websphere
Hi, i'm working with WSAD 5.0 to program some webapps with the builtin Struts 1.1 Beta. Now i want to use the Struts Validator, but as the builtin WSAD Struts Version doesn't support it and doesn't give me a validator-rules.xml, i want to replace it with the latest Struts release. Does anyone know if its prossible without any problems ? Thanx Rouven - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: Struts Validator with special characters
Hello, Thursday, November 27, 2003, 3:11:40 PM, Samuel wrote: SOBtsc> do This: SOBtsc> SOBtsc> SOBtsc> alphanumeric SOBtsc> ^[a-zA-Z0-9\.\ü\Ü\ä\Ä\ß\ö\Ö\-]*$ SOBtsc> SOBtsc> SOBtsc> alphanumericSP SOBtsc> ^[a-zA-Z0-9\.\ü\Ü\ä\Ä\ß\ö\Ö\-\ ]*$ SOBtsc> SOBtsc> Same thing, does not work.. Thanks anyway, Arne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Struts Validator with special characters
do This: alphanumeric ^[a-zA-Z0-9\.\ü\Ü\ä\Ä\ß\ö\Ö\-]*$ alphanumericSP ^[a-zA-Z0-9\.\ü\Ü\ä\Ä\ß\ö\Ö\-\ ]*$ -Ursprüngliche Nachricht- Von: Arne Brutschy [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 27. November 2003 12:20 An: [EMAIL PROTECTED] Betreff: Struts Validator with special characters Hello, I found a problem with the struts validator. It seems that it is not possible to use special characters (like german "Umlaute") in an regular expression.. I tried this: name ^[\-\'\`\´\.\ a-zäöüßáéíúóàèìùòâêîôûñA-ZÄÖÜÁÉÍÓÚÀÈÌÒÙÑ]+$ Hans Mueller evaluates, Hans Müller doesn't. The RegExp is simple and works with an external tester. Even if I use the simpler regexp ^[a-züA-Z]+$ "Hans Müller" does not evaluate. Is this some sort of encoding problem? I thought, http is clearly designed for 8bit-use. Can anybody explain this? Did I something wrong or is this a struts-bug? Regards, Arne - 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]
Struts Validator with special characters
Hello, I found a problem with the struts validator. It seems that it is not possible to use special characters (like german "Umlaute") in an regular expression.. I tried this: name ^[\-\'\`\´\.\ a-zäöüßáéíúóàèìùòâêîôûñA-ZÄÖÜÁÉÍÓÚÀÈÌÒÙÑ]+$ Hans Mueller evaluates, Hans Müller doesn't. The RegExp is simple and works with an external tester. Even if I use the simpler regexp ^[a-züA-Z]+$ "Hans Müller" does not evaluate. Is this some sort of encoding problem? I thought, http is clearly designed for 8bit-use. Can anybody explain this? Did I something wrong or is this a struts-bug? Regards, Arne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts & Validator question
Answer to Question 1: public final class orgForm extends ValidatorForm Answer to Question 2: I have double checked the case and spelling of the file name. Both the action and org_edit.jsp can be reached in the same directory. I assume the question you are posing has to do with the URL used to access either. Both can be reached in the http://localhost:8080/app_root directory. I have looked at this too long so I may not be seeing something but I did go through the exercise validating each of the configuration items against a couple of struts books and the Validator document on the Struts site. Its late and I know I must be staring at the issue and just not realizing it. David > -Original Message- > From: David Friedman [mailto:[EMAIL PROTECTED] > Sent: Sunday, November 23, 2003 11:09 PM > To: Struts Users Mailing List > Subject: RE: Struts & Validator question > > > Two questions immediately come to mind from what you documented: > > 1. Does com.hp.ipg.ne.pgpm.forms.orgForm extend > org.apache.struts.validator.ValidatorForm > or > org.apache.struts.validator.ValidatorActionForm > > 2. The 'input="org_edit.jsp" is context sensitive. Can you > reach org_edit.jsp from the same level as your /org_insert.do action? > > *** This sounds like the problem since you wrote you're > seeing a blank html page, as if it cannot find the JSP page. > > Regards, > David > > -Original Message- > From: LACKEY,DAVID (HP-PaloAlto,ex1) [mailto:[EMAIL PROTECTED] > Sent: Monday, November 24, 2003 1:58 AM > To: Struts Users Mailing List > Subject: Struts & Validator question > > > All, > > I posted this a few hours ago on the jakarta-commons list and > have not come up with a solution yet. I decided to commit > the sin of x-posting it here since this may very well be a > struts issue. > > I hope this is not a newbie question. I have RTFM several > times. I suspect I must be missing something simple. I have > installed Tomcat 4.1.29 and Struts 1.1 with the Validator > included. I have configured my installation as follows > > struts-config.xml: >type="com.hp.ipg.ne.pgpm.forms.orgForm"/> > . > . > . > >name="orgForm" > type="com.hp.ipg.ne.pgpm.actions.orgInsertAction" > scope="request" > validate="true" > input="org_edit.jsp" > > > > > . > . > . > > . > . > . > > value="/WEB-INF/validator-rules.xml, > > /WEB-INF/validation.xml"/> > > > Validation.xml: > > > > >depends="required"> > > > > > > > Application:properties: > errors.required={0} is required. > > In the org_edit.jsp file contains the following code snippet: > > > > > > > > > > > I have stepped through the execution several times and see > the validator being activated. I even see the failed > validation (empty field). However, after the failed > validation, it seems validator is unable to construct a > proper forward to send me back to the JSP page where the > error was entered (or not entered in this case). I am simply > forwarded to a nearly blank page with minimal and tags. > > I have tried changing the input parameter to point at a > global & local forward as well as an Action forward. None of > them succeed. However, when pointed at a forward the browser > does display a message indicating that the server was unable > to look up a mapping for an action named "/misc". The > characters "misc" do not appear anywhere in my > struts-config.xml file. I am guessing this must be some kind > of default behavior. > > Any thoughts would be appreciated. > > > David Lackey > [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]
RE: Struts & Validator question
Two questions immediately come to mind from what you documented: 1. Does com.hp.ipg.ne.pgpm.forms.orgForm extend org.apache.struts.validator.ValidatorForm or org.apache.struts.validator.ValidatorActionForm 2. The 'input="org_edit.jsp" is context sensitive. Can you reach org_edit.jsp from the same level as your /org_insert.do action? *** This sounds like the problem since you wrote you're seeing a blank html page, as if it cannot find the JSP page. Regards, David -Original Message- From: LACKEY,DAVID (HP-PaloAlto,ex1) [mailto:[EMAIL PROTECTED] Sent: Monday, November 24, 2003 1:58 AM To: Struts Users Mailing List Subject: Struts & Validator question All, I posted this a few hours ago on the jakarta-commons list and have not come up with a solution yet. I decided to commit the sin of x-posting it here since this may very well be a struts issue. I hope this is not a newbie question. I have RTFM several times. I suspect I must be missing something simple. I have installed Tomcat 4.1.29 and Struts 1.1 with the Validator included. I have configured my installation as follows struts-config.xml: . . . . . . . . . Validation.xml: Application:properties: errors.required={0} is required. In the org_edit.jsp file contains the following code snippet: I have stepped through the execution several times and see the validator being activated. I even see the failed validation (empty field). However, after the failed validation, it seems validator is unable to construct a proper forward to send me back to the JSP page where the error was entered (or not entered in this case). I am simply forwarded to a nearly blank page with minimal and tags. I have tried changing the input parameter to point at a global & local forward as well as an Action forward. None of them succeed. However, when pointed at a forward the browser does display a message indicating that the server was unable to look up a mapping for an action named "/misc". The characters "misc" do not appear anywhere in my struts-config.xml file. I am guessing this must be some kind of default behavior. Any thoughts would be appreciated. David Lackey [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]
Struts & Validator question
All, I posted this a few hours ago on the jakarta-commons list and have not come up with a solution yet. I decided to commit the sin of x-posting it here since this may very well be a struts issue. I hope this is not a newbie question. I have RTFM several times. I suspect I must be missing something simple. I have installed Tomcat 4.1.29 and Struts 1.1 with the Validator included. I have configured my installation as follows struts-config.xml: . . . . . . . . . Validation.xml: Application:properties: errors.required={0} is required. In the org_edit.jsp file contains the following code snippet: I have stepped through the execution several times and see the validator being activated. I even see the failed validation (empty field). However, after the failed validation, it seems validator is unable to construct a proper forward to send me back to the JSP page where the error was entered (or not entered in this case). I am simply forwarded to a nearly blank page with minimal and tags. I have tried changing the input parameter to point at a global & local forward as well as an Action forward. None of them succeed. However, when pointed at a forward the browser does display a message indicating that the server was unable to look up a mapping for an action named "/misc". The characters "misc" do not appear anywhere in my struts-config.xml file. I am guessing this must be some kind of default behavior. Any thoughts would be appreciated. David Lackey [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Validator + Cross Locale Validations.
Using Struts validator how can I do cross locale validations? Meaning, I want the validation to be done on one locale, but the error message should be from other locale. Example, The validation should be according to de-DE locale, but the error message should be of en-CA Thanks in Advance, Vara Prasad - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Indexed Properties & Struts Validator
I would like to know how to use the Struts Validator with indexed properties. I cannot display error messages under the field (but the validator obviously works and performs validation). Below is the relevant parts of my JSP ,valdiation.xml file and form : Upon submission of the JSP's form, I can see the validator does not validate the 'orderNumber' property if it is empty. But no error messages is displayed. Can an error message be displayed under the input field if the property being validated is indexed ? If I try to modify the validation.xml in order to include : indexedListProperty="parameter" rather than indexedListProperty="parameters" (which I would image is the good thing to do in order to match the "parameter[i].orderNumber" property name), then I get an exception when validation happens. java.lang.NoSuchMethodException: Property 'parameter' has no getter method org.apache.commons.beanutils.PropertyUtils.getSimpleProperty(PropertyUtils.java:1180) org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:772) org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801) org.apache.commons.validator.Validator.validateField(Validator.java:487) org.apache.commons.validator.Validator.validate(Validator.java:582) org.apache.struts.validator.ValidatorActionForm.validate(ValidatorActionForm.java:121) com.rubis.web.system.action.SubmitStrategyAction.save(SubmitStrategyAction.java:71) Can anybody let me know what's wrong with my code ? Fred JSP .../... .../... validation.xml *** form setter and getter methods *** public LinkedList getParameters() { return parameters; } public void setParameters(LinkedList parameters) { this.parameters = parameters; } public ParamInterfaceElementBean getParameter(int index) { while( index >= parameters.size() ){ parameters.add(new ParamInterfaceElementBean()); } return (ParamInterfaceElementBean) parameters.get(index); } public void setParameter(int index, ParamInterfaceElementBean parameter) { while ( index >= parameters.size() ){ parameters.add(new ParamInterfaceElementBean()); } parameters.set(index, parameter); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts Validator with Indexed Properties
Vijay, Thanks for your answer. I tried what you suggested, with no success. I get an exception saying that the getter method is not found : java.lang.NoSuchMethodException: Property 'parameter' has no getter method at org.apache.commons.beanutils.PropertyUtils.getSimpleProperty(PropertyUtils.java:1180) at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:772) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801) at org.apache.commons.validator.Validator.validateField(Validator.java:487) at org.apache.commons.validator.Validator.validate(Validator.java:582) at org.apache.struts.validator.ValidatorActionForm.validate(ValidatorActionForm.java:121) at com.rubis.web.system.action.SubmitStrategyAction.save(SubmitStrategyAction.java:71) Here are the getter/setter methods of the form : private LinkedList parameters; public LinkedList getParameters() { return parameters; } public void setParameters(LinkedList parameters) { this.parameters = parameters; } public ParamInterfaceElementBean getParameter(int index) { while( index >= parameters.size() ){ parameters.add(new ParamInterfaceElementBean()); } return (ParamInterfaceElementBean) parameters.get(index); } public void setParameter(int index, ParamInterfaceElementBean parameter) { while ( index >= parameters.size() ){ parameters.add(new ParamInterfaceElementBean()); } parameters.set(index, parameter); } Do you have a clue about what I'm doing wirng ? Fred Le lun 03/11/2003 Ã 13:25, Vijaykumar a Ãcrit : > Hi Frederic, > > I thing in validation.xml u must provide your setting as > > property="orderNumber" > indexedListProperty="parameter" > depends="required,integer,positive"> > > > > You have specified it as > indexedListProperty="parameters" > > Plz Verify your validation.xml. > > -Vijay > > > Frederic Dernbach wrote: > > >I would like to know how to use the Struts Validator with indexed > >properties. > > > >I cannot display error messages under the field (but the validator > >obviously works and performs validation). > > > >Below is the relevant parts of my JSP and of my valdiation.xml file : > >Upon submission of the JSP's form, I can see the validator does not > >validate the 'orderNumber' property if it is empty. But no error > >messages is displayed. > > > >Can an error message be displayed under the input field if the property > >being validated is indexed ? > > > >Fred > > > > > > JSP > > > > > > > > > >.../... > > >property="parameters" > >id="parameter" > >type="com.rubis.web.system.bean.ParamInterfaceElementBean"> > > > > > > >property="orderNumber" > >indexed="true"/> > > > >.../... > > > > > > > > > > validation.xml > > >property="orderNumber" > >indexedListProperty="parameters" > >depends="required,integer,positive"> > > > > > > > > > > > > > > > > > >- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > Your favorite stores, helpful shopping tools and great gift ideas. > Experience the convenience of buying online with [EMAIL PROTECTED] > http://shopnow.netscape.com/ > > > > - > 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: Struts Validator with Indexed Properties
Hi Frederic, I thing in validation.xml u must provide your setting as You have specified it as indexedListProperty="parameters" Plz Verify your validation.xml. -Vijay Frederic Dernbach wrote: I would like to know how to use the Struts Validator with indexed properties. I cannot display error messages under the field (but the validator obviously works and performs validation). Below is the relevant parts of my JSP and of my valdiation.xml file : Upon submission of the JSP's form, I can see the validator does not validate the 'orderNumber' property if it is empty. But no error messages is displayed. Can an error message be displayed under the input field if the property being validated is indexed ? Fred JSP .../... property="parameters" id="parameter" type="com.rubis.web.system.bean.ParamInterfaceElementBean"> property="orderNumber" indexed="true"/> .../... validation.xml - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with [EMAIL PROTECTED] http://shopnow.netscape.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Validator with Indexed Properties
I would like to know how to use the Struts Validator with indexed properties. I cannot display error messages under the field (but the validator obviously works and performs validation). Below is the relevant parts of my JSP and of my valdiation.xml file : Upon submission of the JSP's form, I can see the validator does not validate the 'orderNumber' property if it is empty. But no error messages is displayed. Can an error message be displayed under the input field if the property being validated is indexed ? Fred JSP .../... .../... validation.xml - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using DispatchAction class with Struts Validator
Indeed, each dispatch method corresponds to a different jsp page. However, the "page" attribute is designed for building up an ActionForm from many different pages in wizard like way. I'm looking only to perform a specific type of validation on a subset of my ActionForm for each dispatch method. The only other solution I know of is to break up my DispatchAction to seperate Actions and use seprate ActionForms for each, not something I want to do unless absolutely necessary! -Burhan Mike Jasnowski wrote: > Do you have corresponding pages for each method? Would the "page" attribute > enable you to only validate fields relevant to the corresponding dispatch > method? Or have I missed your question. > > -Original Message- > From: Burhan Nazir [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 17, 2003 12:50 PM > To: [EMAIL PROTECTED] > Subject: Using DispatchAction class with Struts Validator > > > Got a problem thats been bugging me for a while: > > I'm using an action class that extends DispatchAction class. The methods in > this class use the same ActionForm class (DynaValidatorActionForm). > However, > the validation requirments for each method in the dispatch class are > different. > > I understand that if I use the DynaValidatorActionForm, I can map the action > URI to the name property in the validation.xml file. Is it possible to map > the exact method in my dispacth to the validation.xml file? > > For example, if my DispatchAction class URI path mapping is: "/dispatch", > and > I have a method named "update1" and "update2" within the dispatch class, can > I do this in > my validation.xml file?: > > > > ..do special validation here > > > ..do special validation here > > > > Many thanks for your help! > -Burhan > > > > > -- > FreeBSD 4.8-STABLE * http://www.freebsd.org > 5:40PM up 127 days, 2:09, 11 users, load averages: 0.00, 0.00, 0.00 > > - > 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] -- FreeBSD 4.8-STABLE * http://www.freebsd.org 6:03PM up 127 days, 2:33, 11 users, load averages: 0.10, 0.03, 0.01 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using DispatchAction class with Struts Validator
Do you have corresponding pages for each method? Would the "page" attribute enable you to only validate fields relevant to the corresponding dispatch method? Or have I missed your question. -Original Message- From: Burhan Nazir [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 12:50 PM To: [EMAIL PROTECTED] Subject: Using DispatchAction class with Struts Validator Got a problem thats been bugging me for a while: I'm using an action class that extends DispatchAction class. The methods in this class use the same ActionForm class (DynaValidatorActionForm). However, the validation requirments for each method in the dispatch class are different. I understand that if I use the DynaValidatorActionForm, I can map the action URI to the name property in the validation.xml file. Is it possible to map the exact method in my dispacth to the validation.xml file? For example, if my DispatchAction class URI path mapping is: "/dispatch", and I have a method named "update1" and "update2" within the dispatch class, can I do this in my validation.xml file?: ..do special validation here ..do special validation here Many thanks for your help! -Burhan -- FreeBSD 4.8-STABLE * http://www.freebsd.org 5:40PM up 127 days, 2:09, 11 users, load averages: 0.00, 0.00, 0.00 - 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]
Using DispatchAction class with Struts Validator
Got a problem thats been bugging me for a while: I'm using an action class that extends DispatchAction class. The methods in this class use the same ActionForm class (DynaValidatorActionForm). However, the validation requirments for each method in the dispatch class are different. I understand that if I use the DynaValidatorActionForm, I can map the action URI to the name property in the validation.xml file. Is it possible to map the exact method in my dispacth to the validation.xml file? For example, if my DispatchAction class URI path mapping is: "/dispatch", and I have a method named "update1" and "update2" within the dispatch class, can I do this in my validation.xml file?: ..do special validation here ..do special validation here Many thanks for your help! -Burhan -- FreeBSD 4.8-STABLE * http://www.freebsd.org 5:40PM up 127 days, 2:09, 11 users, load averages: 0.00, 0.00, 0.00 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts Validator and Hidden Field
Octavia, I bit of a guess on my part, but it sounds like you want to use the "requiredif" validator. This allows a particular field to be required (or not) based on other fields. The fact that this might be a hidden field should be, as pointed out by others, transparent to the validator. However, also pointed out is the most troubling question: if it is on a hidden field and your validation fails, what can your users possibly ever do to correct the situation? Octavia Yung wrote: Thanks for the responses, David and Wendy. In order to determine if a particular form field is required, I need to determine the property of another field. Therefore, I thought it would be best to hold this other property in a hidden field. I have tried to validate it as any other input field, but have not had any luck. Any suggestions/ideas? Thanks much! - Original Message - From: "Wendy Smoak" <[EMAIL PROTECTED]> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]> Sent: Thursday, August 28, 2003 3:36 PM Subject: RE: Struts Validator and Hidden Field I was wondering if it is possible to validate a hidden field using the Struts Validator framework. If so, an example would be extremely helpful. Validator is a separate project in the Jakarta Commons, it's not part of Struts proper. Sure you could validate a hidden field, but what's the poor user supposed to do when you toss back an error that such-and-such field is required? He can't DO anything about it, the field is hidden! (Unless perhaps there's client side scripting setting a value when he fills in a visible field?) I don't see it as any different than validating a text box, did you try it and it didn't work? By the time the request gets turned into a Form bean, Struts doesn't know or care that the field was hidden on the HTML form it came from. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM - 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: Struts Validator and Hidden Field
Octavia wrote: > I have tried to validate it as any other input field, but have not had any luck. > Any suggestions/ideas? Thanks much! You'll have to post some of your code before anyone will have any idea why it's not working. The Validator also logs copious amounts of info, you should be able to tell if your rule is getting picked up from the XML file by looking in the logs. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM
Re: Struts Validator and Hidden Field
Thanks for the responses, David and Wendy. In order to determine if a particular form field is required, I need to determine the property of another field. Therefore, I thought it would be best to hold this other property in a hidden field. I have tried to validate it as any other input field, but have not had any luck. Any suggestions/ideas? Thanks much! - Original Message - From: "Wendy Smoak" <[EMAIL PROTECTED]> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]> Sent: Thursday, August 28, 2003 3:36 PM Subject: RE: Struts Validator and Hidden Field > > I was wondering if it is possible to validate a hidden field using the > > Struts Validator framework. If so, an example would be extremely helpful. > > > Validator is a separate project in the Jakarta Commons, it's not part of > Struts proper. > > Sure you could validate a hidden field, but what's the poor user supposed to > do when you toss back an error that such-and-such field is required? He > can't DO anything about it, the field is hidden! (Unless perhaps there's > client side scripting setting a value when he fills in a visible field?) > > I don't see it as any different than validating a text box, did you try it > and it didn't work? By the time the request gets turned into a Form bean, > Struts doesn't know or care that the field was hidden on the HTML form it > came from. > > -- > Wendy Smoak > Applications Systems Analyst, Sr. > Arizona State University, PA, IRM > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Validator and Hidden Field
> I was wondering if it is possible to validate a hidden field using the > Struts Validator framework. If so, an example would be extremely helpful. Validator is a separate project in the Jakarta Commons, it's not part of Struts proper. Sure you could validate a hidden field, but what's the poor user supposed to do when you toss back an error that such-and-such field is required? He can't DO anything about it, the field is hidden! (Unless perhaps there's client side scripting setting a value when he fills in a visible field?) I don't see it as any different than validating a text box, did you try it and it didn't work? By the time the request gets turned into a Form bean, Struts doesn't know or care that the field was hidden on the HTML form it came from. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM
Re: Struts Validator and Hidden Field
As far as I was aware validating a hidden field is the exact same as validating any other field.. just make sure the name of the field in your To: <[EMAIL PROTECTED]> Sent: Thursday, August 28, 2003 4:13 PM Subject: Struts Validator and Hidden Field Hi Everyone, I was wondering if it is possible to validate a hidden field using the Struts Validator framework. If so, an example would be extremely helpful. Thanks in advance! Octavia - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Validator and Hidden Field
Hi Everyone, I was wondering if it is possible to validate a hidden field using the Struts Validator framework. If so, an example would be extremely helpful. Thanks in advance! Octavia
Re: Struts Validator mask
I'm not familiar with the use of double quotes in regexes. However, you seem to have the right idea. Instead of quotes, try using \\ in place of each \ you want to match. E.g.: ^\\(\\[A-Za-z0-0_-]+)+\\?$ Quick explanation \\ - Must start with a single backslash (\\[A-Za-z0-0_-]+) - A pattern representing a backslash followed by one or more valid letters/numbers/symbols. If - is the last character in a [ ] block, it loses its special meaning and just matches -. The pattern is wrapped in () and specified to occur 1 or more times with +. Finally, there's a trailing \\? saying the path may optionally end with \. Don't know if you want that or not. NOTE: this pattern won't allow "\\". Don't know if that matters. K.C. Daniel Massie wrote: I am trying to write a regular expression to represent a network path. Network paths are of the form \\path\to\folder The regular expression which I thought would achieve this is ^"\"{2}([A-Za-z0-9]"-_")+"\"{1}([A-Za-z0-9]"-_\")+$ But I am having no luck. Can anyone help? Thanks Daniel Massie - 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]
Struts Validator mask
I am trying to write a regular expression to represent a network path. Network paths are of the form \\path\to\folder The regular expression which I thought would achieve this is ^"\"{2}([A-Za-z0-9]"-_")+"\"{1}([A-Za-z0-9]"-_\")+$ But I am having no luck. Can anyone help? Thanks Daniel Massie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using Struts validator framework outside of struts
--- Mehran Zonouzi <[EMAIL PROTECTED]> wrote: > Hi, > > I am very new to the validator framework. I would like to use it outside > of Struts framework. Is it possible to do this? > If so can someone point me in the right direction plz... Commons Validator is usable outside of Struts but you'll have to do a bit more work to replicate what Struts does for you. Commons Validator provides some basic functionality that lets you build pluggable validations. However, it doesn't provide any pluggable validations out of the box. Also, you'll need to handle resource bundles and messaging yourself. Commons Validator exposes message keys and bundle names but you need to do the lookup to get the actual message text. David > > Thank you > > > -- > > This e-mail may contain confidential and/or privileged information. If > you are not the intended recipient (or have received this e-mail in > error) please notify the sender immediately and destroy this e-mail. Any > unauthorized copying, disclosure or distribution of the material in this > e-mail is strictly forbidden. > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using Struts validator framework outside of struts
Thanx Jeff. I will have a read. Jeff Kyser <[EMAIL PROTECTED]To: "Struts Users Mailing List" <[EMAIL PROTECTED]> net> cc: Subject: Re: Using Struts validator framework outside of struts 18/08/03 12:26 Please respond to "Struts Users Mailing List" The O'Reilly book 'Jakarta Struts' by Chuck Cavaness has a small section on the subject starting on page 279 that might be of help. I've never tried it though... -jeff On Monday, August 18, 2003, at 03:49 AM, Mehran Zonouzi wrote: > Hi, > > I am very new to the validator framework. I would like to use it > outside of Struts framework. Is it possible to do this? > If so can someone point me in the right direction plz... > > Thank you > > > -- > > This e-mail may contain confidential and/or privileged information. If > you are not the intended recipient (or have received this e-mail in > error) please notify the sender immediately and destroy this e-mail. > Any unauthorized copying, disclosure or distribution of the material > in this e-mail is strictly forbidden. > > > > - > 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] -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using Struts validator framework outside of struts
The O'Reilly book 'Jakarta Struts' by Chuck Cavaness has a small section on the subject starting on page 279 that might be of help. I've never tried it though... -jeff On Monday, August 18, 2003, at 03:49 AM, Mehran Zonouzi wrote: Hi, I am very new to the validator framework. I would like to use it outside of Struts framework. Is it possible to do this? If so can someone point me in the right direction plz... Thank you -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - 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]
Using Struts validator framework outside of struts
Hi, I am very new to the validator framework. I would like to use it outside of Struts framework. Is it possible to do this? If so can someone point me in the right direction plz... Thank you -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Validator for map backed beans
Can anybody confirm that map backed beans don't have validator. like if I have codeId (0n) n varies. On the Jsp I have value(codeId0)...value(codeIdn) the last char n is the last number to validate this , instead of entering n entries in the validation.xml I wanted it to do it with just one entry value(codeId). Does anyone know , if such validation exists, if yes please let me know. or I have already started working on MapValidator. Thanks Panchasheel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Validator Javascript
Didn't know about the bug list, but excuse me for not knowing that, can you drop me the link for the bug-list please. Just for those of you who don't have faith in it, it does work, but needs a little or more fixing and improvement. Overall, I'd say it's a good pretty good infrastructure still needing more care and attention. Currently the only solution I have for myself is coding it myself and hoping to see what comes around in the future releases. And yes, I am special :) my mother told me so. Erez -Original Message- From: Reinhard [mailto:[EMAIL PROTECTED] Sent: Sunday, August 10, 2003 5:40 PM To: Struts Users Mailing List Subject: Re: Struts Validator Javascript > ... Am I so special :) ;-) If I remember it well, it's an open issue in the bug-list. cheers Reinhard - 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: Struts Validator for map backed beans
Sorry, I'd like to help you. But I don't quite understand what you are asking. What is "I have codeId (0n) n varies"? If you want to know if you can validate indexed properties, the answer is Yes. See requireiif example on: http://jakarta.apache.org/struts/userGuide/dev_validator.html -Original Message- From: Gandle, Panchasheel [mailto:[EMAIL PROTECTED] Sent: August 11, 2003 8:43 AM To: 'Struts Users Mailing List' Subject: Struts Validator for map backed beans Can anybody confirm that map backed beans don't have validator. like if I have codeId (0n) n varies. On the Jsp I have value(codeId0)...value(codeIdn) the last char n is the last number to validate this , instead of entering n entries in the validation.xml I wanted it to do it with just one entry value(codeId). Does anyone know , if such validation exists, if yes please let me know. or I have already started working on MapValidator. Thanks Panchasheel - 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: Struts Validator for map backed beans
Hi! Didn't get a chance to check the newsgroup until now. Try: -Original Message- From: Gandle, Panchasheel [mailto:[EMAIL PROTECTED] Sent: August 11, 2003 1:33 PM To: '[EMAIL PROTECTED]' Subject: RE: Struts Validator for map backed beans I have a map-backed bean and the corresponding jsp displays <% int n=100; // n can be anything depending on DB data... for (int i=0;i <% } %> I need the validator with just one entry value(codeId) in validation.xml mailto:[EMAIL PROTECTED] Sent: Monday, August 11, 2003 2:31 PM To: 'Struts Users Mailing List' Subject: RE: Struts Validator for map backed beans Sorry, I'd like to help you. But I don't quite understand what you are asking. What is "I have codeId (0n) n varies"? If you want to know if you can validate indexed properties, the answer is Yes. See requireiif example on: http://jakarta.apache.org/struts/userGuide/dev_validator.html -Original Message- From: Gandle, Panchasheel [mailto:[EMAIL PROTECTED] Sent: August 11, 2003 8:43 AM To: 'Struts Users Mailing List' Subject: Struts Validator for map backed beans Can anybody confirm that map backed beans don't have validator. like if I have codeId (0n) n varies. On the Jsp I have value(codeId0)...value(codeIdn) the last char n is the last number to validate this , instead of entering n entries in the validation.xml I wanted it to do it with just one entry value(codeId). Does anyone know , if such validation exists, if yes please let me know. or I have already started working on MapValidator. Thanks Panchasheel - 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]
RE: Struts Validator
> > You offered this to the OS community with insufficient > > documentation. > > Yeah, that's what open source is all about. The hell it is. If it was, OS would still be something geeks twiddle on their own time while earning food money working with software that is properly documented. You won't get anywhere, if your stuff is not properly documented. -TPP - This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Validator
Time to put up or shut up, Mark. If there are specific bugs you have encountered with Validator, please report them via Bugzilla so they can be addressed. (Patches would also be nice). Failing that, why not write something yourself and donate it so we can call your hard work crap? Otherwise, please give it a rest. Steve > -Original Message- > From: Mark Galbreath [mailto:[EMAIL PROTECTED] > Sent: August 13, 2003 1:41 PM > To: 'Struts Users Mailing List' > Subject: RE: Struts Validator > > > Validator is crap; don't waste your time. > > Mark > > -Original Message- > From: Stephen Bennett [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 13, 2003 11:39 AM > To: [EMAIL PROTECTED] > Subject: Struts Validator > > > Has anyone had any problems getting the Struts Validator to work? > > I have a small sample app that works OK but cannot get my main > app to work! > As far as I can see I have done everything the same as in the sample one. > > I have noticed that when the sample app that works starts up I get four > messages from the ValidatorPlugin the first pair mentions the > validation.xml > and the validator-rules.xml then later it says ValidatorPlugin > initResources > then the previous xml messages. > > With the real app that doesn't work I don't get these second initResources > messages. I am not sure if this is significant or not, does > anyone have any > ideas? > > I have: - > > >property="pathnames" > value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/> > > > in my struts-config > > and > > >property="code" > depends="required"> > > >property="constant" > depends="required,integer"> > > > > > in my validation.xml > > validator-rules.xml are default > > my formbean is extending ValidatorActionForm > > and my action mapping is > >path="/ValidationType" > name="validationTypeForm" > input="/jsp/validationtype/validationType.jsp" > type="com.mycompany.ValidationTypeAction" > scope="session"> > > > > > I am using Struts 1.1 with Tomcat 4.1.24 on XP > > Can anyone help? > > Thanks > > Steve > > > > - > 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: [OT] RE: Struts Validator
Yah, we have weapons. We are NOT forced to resort to the truth. LOL. At 06:21 PM 8/13/2003 -0500, Jeff Kyser wrote: Just threaten to repost [Mark's] String.length() versus array.length mixup. That ought to quiet him down for a while... :) -jeff On Wednesday, August 13, 2003, at 05:55 PM, Micael wrote: I don't know about the rest of you, but I have found this approach generally not to work. It especially does not work on an expert at it. LOL. I would use this on the quiet type, Steve. I think that with Mark you might find it not completely or utterly or wonderfully successful. But , hopefully this time it will also be fun to watch. At 02:02 PM 8/13/2003 -0700, Steve Raeburn wrote: Time to put up or shut up, Mark. If there are specific bugs you have encountered with Validator, please report them via Bugzilla so they can be addressed. (Patches would also be nice). Failing that, why not write something yourself and donate it so we can call your hard work crap? Otherwise, please give it a rest. Steve > -Original Message- > From: Mark Galbreath [mailto:[EMAIL PROTECTED] > Sent: August 13, 2003 1:41 PM > To: 'Struts Users Mailing List' > Subject: RE: Struts Validator > > > Validator is crap; don't waste your time. > > Mark > > -Original Message- > From: Stephen Bennett [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 13, 2003 11:39 AM > To: [EMAIL PROTECTED] > Subject: Struts Validator > > > Has anyone had any problems getting the Struts Validator to work? > > I have a small sample app that works OK but cannot get my main > app to work! > As far as I can see I have done everything the same as in the sample one. > > I have noticed that when the sample app that works starts up I get four > messages from the ValidatorPlugin the first pair mentions the > validation.xml > and the validator-rules.xml then later it says ValidatorPlugin > initResources > then the previous xml messages. > > With the real app that doesn't work I don't get these second initResources > messages. I am not sure if this is significant or not, does > anyone have any > ideas? > > I have: - > > > > property="pathnames" > value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/> > > > in my struts-config > > and > > > > property="code" > depends="required"> > > > > property="constant" > depends="required,integer"> > > > > > in my validation.xml > > validator-rules.xml are default > > my formbean is extending ValidatorActionForm > > and my action mapping is > > > path="/ValidationType" > name="validationTypeForm" > input="/jsp/validationtype/validationType.jsp" > type="com.mycompany.ValidationTypeAction" > scope="session"> > > > > > I am using Struts 1.1 with Tomcat 4.1.24 on XP > > Can anyone help? > > Thanks > > Steve > > > > - > 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] LEGAL NOTICE This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you - 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] LEGAL NOTICE This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sen
RE: Struts Validator
In the validation.xml file I believe that the validator takes as validate based on form name and as validate based on the action name. Meaning that if the validator "sees" a formbean with the first examples name it does validation and then if it "sees" an action with same name as the second example it will do validation on the associated form. Anyway, in your example you have your action name with not slash so you would have to have either: ...OR You also need to keep in mind that you need to extend ValidationTypeForm must extend ValidatorActionForm to use the action validation and ValidatorForm to use the form validation. -Original Message- From: Stephen Bennett [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 11:39 AM To: [EMAIL PROTECTED] Subject: Struts Validator Has anyone had any problems getting the Struts Validator to work? I have a small sample app that works OK but cannot get my main app to work! As far as I can see I have done everything the same as in the sample one. I have noticed that when the sample app that works starts up I get four messages from the ValidatorPlugin the first pair mentions the validation.xml and the validator-rules.xml then later it says ValidatorPlugin initResources then the previous xml messages. With the real app that doesn't work I don't get these second initResources messages. I am not sure if this is significant or not, does anyone have any ideas? I have: - in my struts-config and in my validation.xml validator-rules.xml are default my formbean is extending ValidatorActionForm and my action mapping is I am using Struts 1.1 with Tomcat 4.1.24 on XP Can anyone help? Thanks Steve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] RE: Struts Validator
Just threaten to repost [Mark's] String.length() versus array.length mixup. That ought to quiet him down for a while... :) -jeff On Wednesday, August 13, 2003, at 05:55 PM, Micael wrote: I don't know about the rest of you, but I have found this approach generally not to work. It especially does not work on an expert at it. LOL. I would use this on the quiet type, Steve. I think that with Mark you might find it not completely or utterly or wonderfully successful. But , hopefully this time it will also be fun to watch. At 02:02 PM 8/13/2003 -0700, Steve Raeburn wrote: Time to put up or shut up, Mark. If there are specific bugs you have encountered with Validator, please report them via Bugzilla so they can be addressed. (Patches would also be nice). Failing that, why not write something yourself and donate it so we can call your hard work crap? Otherwise, please give it a rest. Steve > -Original Message- > From: Mark Galbreath [mailto:[EMAIL PROTECTED] > Sent: August 13, 2003 1:41 PM > To: 'Struts Users Mailing List' > Subject: RE: Struts Validator > > > Validator is crap; don't waste your time. > > Mark > > -Original Message- > From: Stephen Bennett [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 13, 2003 11:39 AM > To: [EMAIL PROTECTED] > Subject: Struts Validator > > > Has anyone had any problems getting the Struts Validator to work? > > I have a small sample app that works OK but cannot get my main > app to work! > As far as I can see I have done everything the same as in the sample one. > > I have noticed that when the sample app that works starts up I get four > messages from the ValidatorPlugin the first pair mentions the > validation.xml > and the validator-rules.xml then later it says ValidatorPlugin > initResources > then the previous xml messages. > > With the real app that doesn't work I don't get these second initResources > messages. I am not sure if this is significant or not, does > anyone have any > ideas? > > I have: - > > > > property="pathnames" > value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/> > > > in my struts-config > > and > > > > property="code" > depends="required"> > > > > property="constant" > depends="required,integer"> > > > > > in my validation.xml > > validator-rules.xml are default > > my formbean is extending ValidatorActionForm > > and my action mapping is > > > path="/ValidationType" > name="validationTypeForm" > input="/jsp/validationtype/validationType.jsp" > type="com.mycompany.ValidationTypeAction" > scope="session"> > > > > > I am using Struts 1.1 with Tomcat 4.1.24 on XP > > Can anyone help? > > Thanks > > Steve > > > > - > 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] LEGAL NOTICE This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you - 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: Struts Validator
Me put up? You offered this to the OS community with insufficient documentation. Just look at the archive for this list and I'll wager there are more questions/complaints about Validator than any other aspect of the Struts community. Me shut up? Why don't you guys PUT UP? Mark -Original Message- From: Steve Raeburn [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 5:02 PM To: Struts Users Mailing List Subject: RE: Struts Validator Time to put up or shut up, Mark. If there are specific bugs you have encountered with Validator, please report them via Bugzilla so they can be addressed. (Patches would also be nice). Failing that, why not write something yourself and donate it so we can call your hard work crap? Otherwise, please give it a rest. Steve > -Original Message- > From: Mark Galbreath [mailto:[EMAIL PROTECTED] > Sent: August 13, 2003 1:41 PM > To: 'Struts Users Mailing List' > Subject: RE: Struts Validator > > > Validator is crap; don't waste your time. > > Mark > > -Original Message- > From: Stephen Bennett [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 13, 2003 11:39 AM > To: [EMAIL PROTECTED] > Subject: Struts Validator > > > Has anyone had any problems getting the Struts Validator to work? > > I have a small sample app that works OK but cannot get my main app to > work! As far as I can see I have done everything the same as in the > sample one. > > I have noticed that when the sample app that works starts up I get > four messages from the ValidatorPlugin the first pair mentions the > validation.xml and the validator-rules.xml then later it says > ValidatorPlugin initResources > then the previous xml messages. > > With the real app that doesn't work I don't get these second > initResources messages. I am not sure if this is significant or not, > does anyone have any ideas? > > I have: - > > >property="pathnames" > value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/> > > > in my struts-config > > and > > >property="code" > depends="required"> > > >property="constant" > depends="required,integer"> > > > > > in my validation.xml > > validator-rules.xml are default > > my formbean is extending ValidatorActionForm > > and my action mapping is > >path="/ValidationType" > name="validationTypeForm" > input="/jsp/validationtype/validationType.jsp" > type="com.mycompany.ValidationTypeAction" > scope="session"> > > > > > I am using Struts 1.1 with Tomcat 4.1.24 on XP > > Can anyone help? > > Thanks > > Steve > > > > - > 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]
RE: Struts Validator
Chuck keeps threatening me to come up to MD to show me that it actually does work, but I think he has refrained from doing so because secretly he knows it's crap, too. Mark -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 4:50 PM To: Struts Users Mailing List Subject: RE: Struts Validator > Validator is crap; don't waste your time. Don't mind Mark, he's perpetually waking up on the wrong side of the bed. Validator is actually one of the coolest features of Struts and combined with DyanActionForms reduces form coding time significantly. I don't think Mark ever got it working but it really doesn't take long to set it up and start playing with it. David > > Mark > > -Original Message- > From: Stephen Bennett [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 13, 2003 11:39 AM > To: [EMAIL PROTECTED] > Subject: Struts Validator > > > Has anyone had any problems getting the Struts Validator to work? > > I have a small sample app that works OK but cannot get my main app to > work! As far as I can see I have done everything the same as in the > sample one. > > I have noticed that when the sample app that works starts up I get > four messages from the ValidatorPlugin the first pair mentions the > validation.xml and the validator-rules.xml then later it says > ValidatorPlugin initResources > then the previous xml messages. > > With the real app that doesn't work I don't get these second > initResources messages. I am not sure if this is significant or not, > does anyone have any > ideas? > > I have: - > > >property="pathnames" > value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/> > > > in my struts-config > > and > > >property="code" > depends="required"> > > >property="constant" > depends="required,integer"> > > > > > in my validation.xml > > validator-rules.xml are default > > my formbean is extending ValidatorActionForm > > and my action mapping is > >path="/ValidationType" > name="validationTypeForm" > input="/jsp/validationtype/validationType.jsp" > type="com.mycompany.ValidationTypeAction" > scope="session"> > > > > > I am using Struts 1.1 with Tomcat 4.1.24 on XP > > Can anyone help? > > Thanks > > Steve > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - 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: Struts Validator
I've included an example of the Two Fields custom validator in the examples at http://www.ninsky.com/struts/ The bundled struts examples are found in the webapps directory of the struts distribution (struts-validator.war). There's lots of good stuff in that directory ;-) Steve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts Validator-nextreleasewhen (was validwhen)
David Graham wrote: I suspect that not too much has changed since the version that shipped with Struts 1.1. A great deal of internal cleanup has happened in commons-validator since its 1.0.2 release as well as new features and a more extensible definition. I think Rob Leland is planning on getting a 1.1 release out soon. Yep, I promised to start on it this weekend writing up the release plan. I am sure I'll have basic questions like how the [EMAIL PROTECTED] do I upload the release to the web site. I have read these docs before a long time ago -Rob David -- Robert Leland [EMAIL PROTECTED] -- Java, J2EE, Struts, Web Application Development 804 N. Kenmore Street +01-703-525-3580 Arlington VA 22201
RE: Struts Validator-validwhen
It's not in Struts 1.1 but it's available in the nightly build and will be in the next release. Steve > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: August 14, 2003 8:32 AM > To: [EMAIL PROTECTED] > Subject: Struts Validator-validwhen > > > > Hi, > The struts Validator > 'validwhen' I could not find anywhere in struts,even though it was > mensioned > in documentation. > If it is available Could anybody please help me where exactly it is > available? > Thanks, > Shailaja > > -- A . S . C . A . P.-- > This message, including any attachments, is intended solely for the person > or entity to which it is addressed and may contain information that is > legally privileged, confidential or otherwise protected from disclosure. > If you are not the intended recipient, please contact sender > immediately by > reply email and destroy all copies. > > > > - > 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]
[OT] RE: Struts Validator
I don't know about the rest of you, but I have found this approach generally not to work. It especially does not work on an expert at it. LOL. I would use this on the quiet type, Steve. I think that with Mark you might find it not completely or utterly or wonderfully successful. But , hopefully this time it will also be fun to watch. At 02:02 PM 8/13/2003 -0700, Steve Raeburn wrote: Time to put up or shut up, Mark. If there are specific bugs you have encountered with Validator, please report them via Bugzilla so they can be addressed. (Patches would also be nice). Failing that, why not write something yourself and donate it so we can call your hard work crap? Otherwise, please give it a rest. Steve > -Original Message- > From: Mark Galbreath [mailto:[EMAIL PROTECTED] > Sent: August 13, 2003 1:41 PM > To: 'Struts Users Mailing List' > Subject: RE: Struts Validator > > > Validator is crap; don't waste your time. > > Mark > > -Original Message- > From: Stephen Bennett [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 13, 2003 11:39 AM > To: [EMAIL PROTECTED] > Subject: Struts Validator > > > Has anyone had any problems getting the Struts Validator to work? > > I have a small sample app that works OK but cannot get my main > app to work! > As far as I can see I have done everything the same as in the sample one. > > I have noticed that when the sample app that works starts up I get four > messages from the ValidatorPlugin the first pair mentions the > validation.xml > and the validator-rules.xml then later it says ValidatorPlugin > initResources > then the previous xml messages. > > With the real app that doesn't work I don't get these second initResources > messages. I am not sure if this is significant or not, does > anyone have any > ideas? > > I have: - > > >property="pathnames" > value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/> > > > in my struts-config > > and > > >property="code" > depends="required"> > > >property="constant" > depends="required,integer"> > > > > > in my validation.xml > > validator-rules.xml are default > > my formbean is extending ValidatorActionForm > > and my action mapping is > >path="/ValidationType" > name="validationTypeForm" > input="/jsp/validationtype/validationType.jsp" > type="com.mycompany.ValidationTypeAction" > scope="session"> > > > > > I am using Struts 1.1 with Tomcat 4.1.24 on XP > > Can anyone help? > > Thanks > > Steve > > > > - > 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] LEGAL NOTICE This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Validator-nextreleasewhen (was validwhen)
> I suspect that not too much has changed since the version that shipped > with > Struts 1.1. A great deal of internal cleanup has happened in commons-validator since its 1.0.2 release as well as new features and a more extensible definition. I think Rob Leland is planning on getting a 1.1 release out soon. David > So, you may not want to push out a new release at this time. > However, it is unfortunate that the ability to modularize development of > larger apps with multiple struts-config files and multiple application > resource files is pretty much there in the Struts 1.1 release except for > mutliple resource files support in Validator. Since it looks like the > support for "bundle" attributes was added at least at the "arg" level, a > dot > release now of just the commons-validator would make it possible to use > multiple resource files to some degree with the Validator in a Struts > 1.1 > webapp. > > I'm not looking for a fixed date commitment. I realize it is all > volunteer > efforts on this stuff that can't be held to any particular schedule. > I'll > totally understand if there are no plans to move towards a dot release > of > Validator anytime soon, but, I am curious as to whether plans to move > towards a dot release are imminent or not even on the horizon. > > -Van > > Mike Van Riper > mailto:[EMAIL PROTECTED] > http://www.baychi.org/bof/struts > > > -Original Message- > > From: Steve Raeburn [mailto:[EMAIL PROTECTED] > > Sent: Thursday, August 14, 2003 8:41 AM > > To: Struts Users Mailing List > > Subject: RE: Struts Validator-validwhen > > > > > > It's not in Struts 1.1 but it's available in the nightly > > build and will be > > in the next release. > > > > Steve > > > > > -Original Message- > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > Sent: August 14, 2003 8:32 AM > > > To: [EMAIL PROTECTED] > > > Subject: Struts Validator-validwhen > > > > > > > > > > > > Hi, > > > The struts Validator > > > 'validwhen' I could not find anywhere in struts,even though it was > > > mensioned > > > in documentation. > > > If it is available Could anybody please help me where > > exactly it is > > > available? > > > Thanks, > > > Shailaja > > > > > > -- A . S . C . A . P.-- > > > This message, including any attachments, is intended solely > > for the person > > > or entity to which it is addressed and may contain > > information that is > > > legally privileged, confidential or otherwise protected > > from disclosure. > > > If you are not the intended recipient, please contact sender > > > immediately by > > > reply email and destroy all copies. > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] RE: Struts Validator
just trying to keep it light... :) -jeff On Thursday, August 14, 2003, at 07:29 AM, Mark Galbreath wrote: *ouch* that's harsh, man...really harsh. :-)~ -Original Message- From: Jeff Kyser [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 7:21 PM To: Struts Users Mailing List Subject: Re: [OT] RE: Struts Validator Just threaten to repost [Mark's] String.length() versus array.length mixup. That ought to quiet him down for a while... :) -jeff On Wednesday, August 13, 2003, at 05:55 PM, Micael wrote: I don't know about the rest of you, but I have found this approach generally not to work. It especially does not work on an expert at it. LOL. I would use this on the quiet type, Steve. I think that with Mark you might find it not completely or utterly or wonderfully successful. But , hopefully this time it will also be fun to watch. At 02:02 PM 8/13/2003 -0700, Steve Raeburn wrote: Time to put up or shut up, Mark. If there are specific bugs you have encountered with Validator, please report them via Bugzilla so they can be addressed. (Patches would also be nice). Failing that, why not write something yourself and donate it so we can call your hard work crap? Otherwise, please give it a rest. Steve -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: August 13, 2003 1:41 PM To: 'Struts Users Mailing List' Subject: RE: Struts Validator Validator is crap; don't waste your time. Mark -Original Message- From: Stephen Bennett [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 11:39 AM To: [EMAIL PROTECTED] Subject: Struts Validator Has anyone had any problems getting the Struts Validator to work? I have a small sample app that works OK but cannot get my main app to work! As far as I can see I have done everything the same as in the sample one. I have noticed that when the sample app that works starts up I get four messages from the ValidatorPlugin the first pair mentions the validation.xml and the validator-rules.xml then later it says ValidatorPlugin initResources then the previous xml messages. With the real app that doesn't work I don't get these second initResources messages. I am not sure if this is significant or not, does anyone have any ideas? I have: - in my struts-config and in my validation.xml validator-rules.xml are default my formbean is extending ValidatorActionForm and my action mapping is redirect="true"/> redirect="true"/> I am using Struts 1.1 with Tomcat 4.1.24 on XP Can anyone help? Thanks Steve - 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] LEGAL NOTICE This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you - 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]
RE: Struts Validator for map backed beans
Hi Yansheng The one you suggested is for fields that are indexed and like codeId[0], codeId[1], codeId[2]...codeId[n]. For map-backed beans it would be value(codeId0), value(codeId1), value(codeId2)value(codeIdn) in which it doesn't work, is there any other solution for map-backed beans validator with multiple input fields in an array... Thanks Panchasheel -Original Message- From: Yansheng Lin [mailto:[EMAIL PROTECTED] Sent: Monday, August 11, 2003 5:47 PM To: 'Struts Users Mailing List' Subject: RE: Struts Validator for map backed beans Hi! Didn't get a chance to check the newsgroup until now. Try: -Original Message- From: Gandle, Panchasheel [mailto:[EMAIL PROTECTED] Sent: August 11, 2003 1:33 PM To: '[EMAIL PROTECTED]' Subject: RE: Struts Validator for map backed beans I have a map-backed bean and the corresponding jsp displays <% int n=100; // n can be anything depending on DB data... for (int i=0;i <% } %> I need the validator with just one entry value(codeId) in validation.xml mailto:[EMAIL PROTECTED] Sent: Monday, August 11, 2003 2:31 PM To: 'Struts Users Mailing List' Subject: RE: Struts Validator for map backed beans Sorry, I'd like to help you. But I don't quite understand what you are asking. What is "I have codeId (0n) n varies"? If you want to know if you can validate indexed properties, the answer is Yes. See requireiif example on: http://jakarta.apache.org/struts/userGuide/dev_validator.html -Original Message- From: Gandle, Panchasheel [mailto:[EMAIL PROTECTED] Sent: August 11, 2003 8:43 AM To: 'Struts Users Mailing List' Subject: Struts Validator for map backed beans Can anybody confirm that map backed beans don't have validator. like if I have codeId (0n) n varies. On the Jsp I have value(codeId0)...value(codeIdn) the last char n is the last number to validate this , instead of entering n entries in the validation.xml I wanted it to do it with just one entry value(codeId). Does anyone know , if such validation exists, if yes please let me know. or I have already started working on MapValidator. Thanks Panchasheel - 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]
RE: Struts Validator
--- Mark Galbreath <[EMAIL PROTECTED]> wrote: > Me put up? You offered this to the OS community with insufficient > documentation. Just look at the archive for this list and I'll wager > there > are more questions/complaints about Validator than any other aspect of > the > Struts community. > Me shut up? Why don't you guys PUT UP? We don't work for you. Steve is right. If you don't have any constructive criticism or patches it's time to quiet down. David > > Mark > > -Original Message- > From: Steve Raeburn [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 13, 2003 5:02 PM > To: Struts Users Mailing List > Subject: RE: Struts Validator > > > Time to put up or shut up, Mark. If there are specific bugs you have > encountered with Validator, please report them via Bugzilla so they can > be > addressed. (Patches would also be nice). > > Failing that, why not write something yourself and donate it so we can > call > your hard work crap? > > Otherwise, please give it a rest. > > Steve > > > -Original Message- > > From: Mark Galbreath [mailto:[EMAIL PROTECTED] > > Sent: August 13, 2003 1:41 PM > > To: 'Struts Users Mailing List' > > Subject: RE: Struts Validator > > > > > > Validator is crap; don't waste your time. > > > > Mark > > > > -Original Message- > > From: Stephen Bennett [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, August 13, 2003 11:39 AM > > To: [EMAIL PROTECTED] > > Subject: Struts Validator > > > > > > Has anyone had any problems getting the Struts Validator to work? > > > > I have a small sample app that works OK but cannot get my main app to > > work! As far as I can see I have done everything the same as in the > > sample one. > > > > I have noticed that when the sample app that works starts up I get > > four messages from the ValidatorPlugin the first pair mentions the > > validation.xml and the validator-rules.xml then later it says > > ValidatorPlugin initResources > > then the previous xml messages. > > > > With the real app that doesn't work I don't get these second > > initResources messages. I am not sure if this is significant or not, > > does anyone have any ideas? > > > > I have: - > > > > > > > property="pathnames" > > value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/> > > > > > > in my struts-config > > > > and > > > > > > > property="code" > > depends="required"> > > > > > > > property="constant" > > depends="required,integer"> > > > > > > > > > > in my validation.xml > > > > validator-rules.xml are default > > > > my formbean is extending ValidatorActionForm > > > > and my action mapping is > > > > > path="/ValidationType" > > name="validationTypeForm" > > input="/jsp/validationtype/validationType.jsp" > > type="com.mycompany.ValidationTypeAction" > > scope="session"> > >redirect="true"/> > >redirect="true"/> > > > > > > I am using Struts 1.1 with Tomcat 4.1.24 on XP > > > > Can anyone help? > > > > Thanks > > > > Steve > > > > > > > > - > > 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] > __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Validator
> Validator is crap; don't waste your time. Don't mind Mark, he's perpetually waking up on the wrong side of the bed. Validator is actually one of the coolest features of Struts and combined with DyanActionForms reduces form coding time significantly. I don't think Mark ever got it working but it really doesn't take long to set it up and start playing with it. David > > Mark > > -Original Message- > From: Stephen Bennett [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 13, 2003 11:39 AM > To: [EMAIL PROTECTED] > Subject: Struts Validator > > > Has anyone had any problems getting the Struts Validator to work? > > I have a small sample app that works OK but cannot get my main app to > work! > As far as I can see I have done everything the same as in the sample > one. > > I have noticed that when the sample app that works starts up I get four > messages from the ValidatorPlugin the first pair mentions the > validation.xml > and the validator-rules.xml then later it says ValidatorPlugin > initResources > then the previous xml messages. > > With the real app that doesn't work I don't get these second > initResources > messages. I am not sure if this is significant or not, does anyone have > any > ideas? > > I have: - > > >property="pathnames" > value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/> > > > in my struts-config > > and > > >property="code" > depends="required"> > > >property="constant" > depends="required,integer"> > > > > > in my validation.xml > > validator-rules.xml are default > > my formbean is extending ValidatorActionForm > > and my action mapping is > >path="/ValidationType" > name="validationTypeForm" > input="/jsp/validationtype/validationType.jsp" > type="com.mycompany.ValidationTypeAction" > scope="session"> > > > > > I am using Struts 1.1 with Tomcat 4.1.24 on XP > > Can anyone help? > > Thanks > > Steve > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Validator
Thanks Shane, that fixed it. -Original Message- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: 13 August 2003 16:41 To: 'Struts Users Mailing List' Subject: RE: Struts Validator In the validation.xml file I believe that the validator takes as validate based on form name and as validate based on the action name. Meaning that if the validator "sees" a formbean with the first examples name it does validation and then if it "sees" an action with same name as the second example it will do validation on the associated form. Anyway, in your example you have your action name with not slash so you would have to have either: ...OR You also need to keep in mind that you need to extend ValidationTypeForm must extend ValidatorActionForm to use the action validation and ValidatorForm to use the form validation. -Original Message- From: Stephen Bennett [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 11:39 AM To: [EMAIL PROTECTED] Subject: Struts Validator Has anyone had any problems getting the Struts Validator to work? I have a small sample app that works OK but cannot get my main app to work! As far as I can see I have done everything the same as in the sample one. I have noticed that when the sample app that works starts up I get four messages from the ValidatorPlugin the first pair mentions the validation.xml and the validator-rules.xml then later it says ValidatorPlugin initResources then the previous xml messages. With the real app that doesn't work I don't get these second initResources messages. I am not sure if this is significant or not, does anyone have any ideas? I have: - in my struts-config and in my validation.xml validator-rules.xml are default my formbean is extending ValidatorActionForm and my action mapping is I am using Struts 1.1 with Tomcat 4.1.24 on XP Can anyone help? Thanks Steve - 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: Struts Validator
+1 - Validator works. I started using it wy back in the pre-RC1 days. Everytime that Validator hasn't worked for me, I've found that it was due to a screw up on my part (usually something in the validation.xml file). Except for rare occasions, I haven't had to write a customized validate method. When I do have to, I try to extend Validator so I can continue to use the tool. +1 - Validator is not perfect. While I haven't found any major bugs (at least ones that haven't already been reported), Validator does have its quirks - you have got to get the validation.xml file right or else it just flat won't work. Also, since Validator relies on your ApplicationResources.properties file for its error messages, it may appear that Validator is not working, when in reality, it just can't find the message to return to the client. +1,000,000 - There is only Us. If not, then Micro$oft would be the only choice for doing web development, and I'd have to find another career :-) Mark - I'll offer this again. I'll be more than happy to look over your forms, struts-config.xml, validator-rules.xml, validation.xml, and properties files and see if I can figure out why you can't get Validator working. Let me know. Jerry Jalenak Team Lead, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] > -Original Message- > From: Steve Raeburn [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 13, 2003 7:30 PM > To: Struts Users Mailing List > Subject: RE: Struts Validator > > > Let me state the blindingly obvious: > > 1. Validator works. Other people seem to be able to use it. > 2. Validator is not perfect. Valid bug reports would help > make it better. > 3. This is a community project. There is no Us and Them, > only Us. And, for > better or worse, that includes you. > > Since you've not posted any bug reports about validator I can > only assume > that you are either (a) blowing hot air, or (b) incapable of > describing the > bugs you say you've found. If you aren't capable of making a > meaningful > contribution, please at least don't waste other people's time > with your > nonsense. > > I'm not going to spend any more time batting this back and > forth with you. > If you are prepared to provide constructive criticism and/or > help improve > Struts, you'll find many people willing to accept your help > and to offer > theirs in return. If not, well it's pretty easy to filter you out. > > Steve > > > -Original Message- > > From: Mark Galbreath [mailto:[EMAIL PROTECTED] > > Sent: August 13, 2003 3:17 PM > > To: 'Struts Users Mailing List'; [EMAIL PROTECTED] > > Subject: RE: Struts Validator > > > > > > Dave, > > > > My only complaint with the authors of validator is that (a) > they say it's > > really cheeky, but (b) a host of developers, including me, > have complaints > > about it. It just doesn't work within the framework > documented. The List > > is full of complaints and requests along these lines. You > can ignore me, > > but just dip into the List archive and see. I write my own > validator > > methods because I couldn't get Validator to work within the Struts > > framework; looking at the archive, there are hundreds more that > > could not do > > the same. > > > > I am not looking for a war here. All I ask is to get the > damn thing right > > before offering it as a release to our community. > > > > Mark > > > > -Original Message- > > From: David Graham [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, August 13, 2003 5:45 PM > > To: Struts Users Mailing List > > Subject: RE: Struts Validator > > > > > > --- Mark Galbreath <[EMAIL PROTECTED]> wrote: > > > Me put up? You offered this to the OS community with insufficient > > > documentation. Just look at the archive for this list > and I'll wager > > > there are more questions/complaints about Validator than any other > > > aspect of the > > > Struts community. > > > Me shut up? Why don't you guys PUT UP? > > > > We don't work for you. Steve is right. If you don't have > any constructive > > criticism or patches it's time to quiet down. > > > > David > > > > > > > > Mark > > > > > -Original Message- > > > From: Steve Raeburn [mailto:[EMAIL PROTECTED] > > > Sent: Wednesday, August 13, 2003 5:02 PM > > > To: Struts Users Mailing List > &g
Struts Validator
Has anyone had any problems getting the Struts Validator to work? I have a small sample app that works OK but cannot get my main app to work! As far as I can see I have done everything the same as in the sample one. I have noticed that when the sample app that works starts up I get four messages from the ValidatorPlugin the first pair mentions the validation.xml and the validator-rules.xml then later it says ValidatorPlugin initResources then the previous xml messages. With the real app that doesn't work I don't get these second initResources messages. I am not sure if this is significant or not, does anyone have any ideas? I have: - in my struts-config and in my validation.xml validator-rules.xml are default my formbean is extending ValidatorActionForm and my action mapping is I am using Struts 1.1 with Tomcat 4.1.24 on XP Can anyone help? Thanks Steve
RE: Struts Validator
--- Brian McSweeney <[EMAIL PROTECTED]> wrote: > Hi Steve, > > >Have you looked at the struts-validator sample app? The 'types' > examples > >show most of the basic validations. If you've already looked at it, is > >there anything that would make it easier to understand? > > No I had not heard about the sample app. I looked again on the main > Struts page and in the validator section there are 3 resources: > > 1) A validating Two fields match by matt raible > (by the way - IMHO this method > /or a different implementation which does the same thing, would be VERY > helpful to be a part of the main validator package as it is such a > common > requirement) > > 2)DynaForms and the Validator - a PDF document > > 3) Validating user input - a PDF document > > Am I missing the link? Is it part of the struts bundle? Yes, it comes with the standard Struts distro. David > > I think a link from the main validator page would be helpful as this is > where I went to initially find out how to use the validator. > > >requiredif is in 1.1. Do you mean validwhen? If so, that's back in the > >nightly build and will be in the next release. > > Cool. :-) > > > > -Original Message- > From: Steve Raeburn [mailto:[EMAIL PROTECTED] > Sent: 14 August 2003 15:47 > To: Struts Users Mailing List > Subject: RE: Struts Validator > > > -----Original Message- > > From: Brian McSweeney [mailto:[EMAIL PROTECTED] > > Sent: August 14, 2003 6:29 AM > > To: 'Struts Users Mailing List' > > Subject: RE: Struts Validator > > > > > > +1 for it works for me too. > > Not knowing javascript well, using the validator allowed me > > to quickly do client side validation. > > > > +1 for it isn't so easy to use. I think a "REALLY" simple default app > > that shows exactly how each different field validation works would > > dramatically increase the use of the validator, which would in turn > > dramatically increase the quality of the validator. > > Have you looked at the struts-validator sample app? The 'types' examples > show most of the basic validations. If you've already looked at it, is > there > anything that would make it easier to understand? > > > > > Even a single jsp page for each field type and a submit button would > > be a help. I only really use it for required strings and emails for > > example. Even though I tried and failed to use required if > > functionality. It's > > a pity that this feature couldn't be included in the struts 1.1 > release. > > requiredif is in 1.1. Do you mean validwhen? If so, that's back in the > nightly build and will be in the next release. > > Steve > > > > > However, at any rate, saying it's absolutely crap is both wrong > > and not so nice IMHO. > > > > Brian > > > > > > -Original Message- > > From: Jerry Jalenak [mailto:[EMAIL PROTECTED] > > Sent: 14 August 2003 14:06 > > To: 'Struts Users Mailing List'; '[EMAIL PROTECTED]' > > Subject: RE: Struts Validator > > > > +1 - Validator works. I started using it wy back in the pre-RC1 > > days. > > Everytime that Validator hasn't worked for me, I've found that it was > > due to > > a screw up on my part (usually something in the validation.xml file). > > Except for rare occasions, I haven't had to write a customized > validate > > method. When I do have to, I try to extend Validator so I can > continue > > to > > use the tool. > > > > +1 - Validator is not perfect. While I haven't found any major bugs > (at > > least ones that haven't already been reported), Validator does have > its > > quirks - you have got to get the validation.xml file right or else it > > just > > flat won't work. Also, since Validator relies on your > > ApplicationResources.properties file for its error messages, it may > > appear > > that Validator is not working, when in reality, it just can't find the > > message to return to the client. > > > > +1,000,000 - There is only Us. If not, then Micro$oft would be the > only > > choice for doing web development, and I'd have to find another career > > :-) > > > > Mark - I'll offer this again. I'll be more than happy to look over > your > > forms, struts-config.xml, validator-rules.xml, validation.xml, and > > properties files and see if I can figure out why you can't get > Validator
Re: Struts Validator Javascript
Sgarlata Matt wrote: I like the concept of the validator, but personally I don't have a lot of confidence in it. that's a bit harsh. I think as long as you know what it does and doesn't do, there's every reason to have confidence in it. It's an excellent package that will benefit even more when people use it and reports bugs or vote for existing ones or even submit patches in bugzilla :O I sense an opportunity to share something I got from the Ant mailing list recently (struts gurus feel free to slap me down if the same sort of thing doesn't apply to struts) : (1) open an enhancement request in bugzilla and attach your patch. If you just send it to the list it could get lost over time. (2) send a mail to [EMAIL PROTECTED] explaining why you think the enhancement is worth it. (3) send a mail to [EMAIL PROTECTED] so that the people who share your opinion can go to the enhancement request and vote for it. (4) be persistent. It is often the case that committers have a lot of time for Ant development in one week and almost none in the next. This could mean you'll need to redo (2). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Validator
Wow! That was impressive. Now I know why Validator sucks. -Original Message- From: Stephen Brown [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 5:52 PM To: 'Struts Users Mailing List' Subject: RE: Struts Validator Get a life, Mark. > You offered this to the OS community with insufficient documentation. Yeah, that's what open source is all about. Deal with it. Oh, did you find the open source project with the good documentation? Urban myth. > -Original Message- > From: Mark Galbreath [mailto:[EMAIL PROTECTED] > Sent: August 13, 2003 5:40 PM > To: 'Struts Users Mailing List'; [EMAIL PROTECTED] > Subject: RE: Struts Validator > > Just look at the archive for this list and > I'll wager there > are more questions/complaints about Validator than any other > aspect of the > Struts community. Me shut up? Why don't you guys PUT UP? > > Mark > > -Original Message- > From: Steve Raeburn [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 13, 2003 5:02 PM > To: Struts Users Mailing List > Subject: RE: Struts Validator > > > Time to put up or shut up, Mark. If there are specific bugs you have > encountered with Validator, please report them via Bugzilla so they > can be addressed. (Patches would also be nice). > > Failing that, why not write something yourself and donate it > so we can call > your hard work crap? > > Otherwise, please give it a rest. > > Steve > > > -Original Message- > > From: Mark Galbreath [mailto:[EMAIL PROTECTED] > > Sent: August 13, 2003 1:41 PM > > To: 'Struts Users Mailing List' > > Subject: RE: Struts Validator > > > > > > Validator is crap; don't waste your time. > > > > Mark > > > > -Original Message- > > From: Stephen Bennett [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, August 13, 2003 11:39 AM > > To: [EMAIL PROTECTED] > > Subject: Struts Validator > > > > > > Has anyone had any problems getting the Struts Validator to work? > > > > I have a small sample app that works OK but cannot get my > main app to > > work! As far as I can see I have done everything the same as in the > > sample one. > > > > I have noticed that when the sample app that works starts up I get > > four messages from the ValidatorPlugin the first pair mentions the > > validation.xml and the validator-rules.xml then later it says > > ValidatorPlugin initResources > > then the previous xml messages. > > > > With the real app that doesn't work I don't get these second > > initResources messages. I am not sure if this is > significant or not, > > does anyone have any ideas? > > > > I have: - > > > > > > > property="pathnames" > > value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/> > > > > > > in my struts-config > > > > and > > > > > > > property="code" > > depends="required"> > > > > > > > property="constant" > > depends="required,integer"> > > > > > > > > > > in my validation.xml > > > > validator-rules.xml are default > > > > my formbean is extending ValidatorActionForm > > > > and my action mapping is > > > > > path="/ValidationType" > > name="validationTypeForm" > > input="/jsp/validationtype/validationType.jsp" > > type="com.mycompany.ValidationTypeAction" > > scope="session"> > >redirect="true"/> > >redirect="true"/> > > > > > > I am using Struts 1.1 with Tomcat 4.1.24 on XP > > > > Can anyone help? > > > > Thanks > > > > Steve > > > > > > > > > - > > 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]
RE: [OT] RE: Struts Validator
*ouch* that's harsh, man...really harsh. :-)~ -Original Message- From: Jeff Kyser [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 7:21 PM To: Struts Users Mailing List Subject: Re: [OT] RE: Struts Validator Just threaten to repost [Mark's] String.length() versus array.length mixup. That ought to quiet him down for a while... :) -jeff On Wednesday, August 13, 2003, at 05:55 PM, Micael wrote: > I don't know about the rest of you, but I have found this approach > generally not to work. It especially does not work on an expert at > it. LOL. I would use this on the quiet type, Steve. I think that > with Mark you might find it not completely or utterly or wonderfully > successful. But , hopefully this time it will also be fun to watch. > > At 02:02 PM 8/13/2003 -0700, Steve Raeburn wrote: >> Time to put up or shut up, Mark. If there are specific bugs you have >> encountered with Validator, please report them via Bugzilla so they >> can be addressed. (Patches would also be nice). >> >> Failing that, why not write something yourself and donate it so we >> can call >> your hard work crap? >> >> Otherwise, please give it a rest. >> >> Steve >> >> > -Original Message- >> > From: Mark Galbreath [mailto:[EMAIL PROTECTED] >> > Sent: August 13, 2003 1:41 PM >> > To: 'Struts Users Mailing List' >> > Subject: RE: Struts Validator >> > >> > >> > Validator is crap; don't waste your time. >> > >> > Mark >> > >> > -Original Message- >> > From: Stephen Bennett [mailto:[EMAIL PROTECTED] >> > Sent: Wednesday, August 13, 2003 11:39 AM >> > To: [EMAIL PROTECTED] >> > Subject: Struts Validator >> > >> > >> > Has anyone had any problems getting the Struts Validator to work? >> > >> > I have a small sample app that works OK but cannot get my main app >> > to work! As far as I can see I have done everything the same as in >> > the >> sample one. >> > >> > I have noticed that when the sample app that works starts up I get >> four >> > messages from the ValidatorPlugin the first pair mentions the >> > validation.xml and the validator-rules.xml then later it says >> > ValidatorPlugin initResources >> > then the previous xml messages. >> > >> > With the real app that doesn't work I don't get these second >> initResources >> > messages. I am not sure if this is significant or not, does anyone >> > have any ideas? >> > >> > I have: - >> > >> > >> > > > property="pathnames" >> > value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/> >> > >> > >> > in my struts-config >> > >> > and >> > >> > >> > > > property="code" >> > depends="required"> >> > >> > >> > > > property="constant" >> > depends="required,integer"> >> > >> > >> > >> > >> > in my validation.xml >> > >> > validator-rules.xml are default >> > >> > my formbean is extending ValidatorActionForm >> > >> > and my action mapping is >> > >> > > > path="/ValidationType" >> > name="validationTypeForm" >> > input="/jsp/validationtype/validationType.jsp" >> > type="com.mycompany.ValidationTypeAction" >> > scope="session"> >> > > redirect="true"/> >> > > redirect="true"/> >> > >> > >> > I am using Struts 1.1 with Tomcat 4.1.24 on XP >> > >> > Can anyone help? >> > >> > Thanks >> > >> > Steve >> > >> > >> > >> > >> - >> > 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] > > > > LEGAL NOTICE > > This electronic mail transmission and any accompanying documents > contain information belonging to the sender which may be confidential > and legally privileged. This information is intended only for the use > of the individual or entity to whom this electronic mail transmission > was sent as indicated above. If you are not the intended recipient, > any disclosure, copying, distribution, or action taken in reliance on > the contents of the information contained in this transmission is > strictly prohibited. If you have received this transmission in error, > please delete the message. Thank you > > > - > 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]
Re: Struts Validator Javascript
I like the concept of the validator, but personally I don't have a lot of confidence in it. The second thing I tried to do with it was use the inRange (or whatever) test, and it didn't work. I use it server-side and only for required fields. Matt - Original Message - From: "Erez Efrati" <[EMAIL PROTECTED]> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]> Sent: Sunday, August 10, 2003 12:28 PM Subject: Struts Validator Javascript > Working with the validator I found that the client-side javascript code > automatically generated by the validator tag does not handle correctly > or at all fields that are radio group , checkbox group or any other type > of group that exist. > I have posted few times on that but no response. After that I went and > fixed the javascript code to do it correctly in the validateRequired() > for instance. I am just wondering, am I the only one to use the client > side validator avascript? Am I so special :) ? Or everyone else is doing > it differently? > I would appreciate any remark. > > Erez > > > > - > 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: Struts Validator
+1 for it works for me too. Not knowing javascript well, using the validator allowed me to quickly do client side validation. +1 for it isn't so easy to use. I think a "REALLY" simple default app that shows exactly how each different field validation works would dramatically increase the use of the validator, which would in turn dramatically increase the quality of the validator. Even a single jsp page for each field type and a submit button would be a help. I only really use it for required strings and emails for example. Even though I tried and failed to use required if functionality. It's a pity that this feature couldn't be included in the struts 1.1 release. However, at any rate, saying it's absolutely crap is both wrong and not so nice IMHO. Brian -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED] Sent: 14 August 2003 14:06 To: 'Struts Users Mailing List'; '[EMAIL PROTECTED]' Subject: RE: Struts Validator +1 - Validator works. I started using it wy back in the pre-RC1 days. Everytime that Validator hasn't worked for me, I've found that it was due to a screw up on my part (usually something in the validation.xml file). Except for rare occasions, I haven't had to write a customized validate method. When I do have to, I try to extend Validator so I can continue to use the tool. +1 - Validator is not perfect. While I haven't found any major bugs (at least ones that haven't already been reported), Validator does have its quirks - you have got to get the validation.xml file right or else it just flat won't work. Also, since Validator relies on your ApplicationResources.properties file for its error messages, it may appear that Validator is not working, when in reality, it just can't find the message to return to the client. +1,000,000 - There is only Us. If not, then Micro$oft would be the only choice for doing web development, and I'd have to find another career :-) Mark - I'll offer this again. I'll be more than happy to look over your forms, struts-config.xml, validator-rules.xml, validation.xml, and properties files and see if I can figure out why you can't get Validator working. Let me know. Jerry Jalenak Team Lead, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] > -Original Message- > From: Steve Raeburn [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 13, 2003 7:30 PM > To: Struts Users Mailing List > Subject: RE: Struts Validator > > > Let me state the blindingly obvious: > > 1. Validator works. Other people seem to be able to use it. > 2. Validator is not perfect. Valid bug reports would help > make it better. > 3. This is a community project. There is no Us and Them, > only Us. And, for > better or worse, that includes you. > > Since you've not posted any bug reports about validator I can > only assume > that you are either (a) blowing hot air, or (b) incapable of > describing the > bugs you say you've found. If you aren't capable of making a > meaningful > contribution, please at least don't waste other people's time > with your > nonsense. > > I'm not going to spend any more time batting this back and > forth with you. > If you are prepared to provide constructive criticism and/or > help improve > Struts, you'll find many people willing to accept your help > and to offer > theirs in return. If not, well it's pretty easy to filter you out. > > Steve > > > -Original Message- > > From: Mark Galbreath [mailto:[EMAIL PROTECTED] > > Sent: August 13, 2003 3:17 PM > > To: 'Struts Users Mailing List'; [EMAIL PROTECTED] > > Subject: RE: Struts Validator > > > > > > Dave, > > > > My only complaint with the authors of validator is that (a) > they say it's > > really cheeky, but (b) a host of developers, including me, > have complaints > > about it. It just doesn't work within the framework > documented. The List > > is full of complaints and requests along these lines. You > can ignore me, > > but just dip into the List archive and see. I write my own > validator > > methods because I couldn't get Validator to work within the Struts > > framework; looking at the archive, there are hundreds more that > > could not do > > the same. > > > > I am not looking for a war here. All I ask is to get the > damn thing right > > before offering it as a release to our community. > > > > Mark > > > > -Original Message- > > From: David Graham [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, August 13, 2003 5
Re: Struts Validator
Mark Galbreath wrote: I am not looking for a war here. All I ask is to get the damn thing right before offering it as a release to our community. Release early, release often. Most open source software would -never- get released if people waited till they got the damn thing right before offering it as a release to our community... and I'd rather be able to use unfinished betaware than wait forever on vaporware. Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Validator-nextreleasewhen (was validwhen)
> -Original Message- > From: David Graham [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 14, 2003 11:01 AM > To: Struts Users Mailing List > Subject: RE: Struts Validator-nextreleasewhen (was validwhen) > > > > I suspect that not too much has changed since the version > that shipped > > with > > Struts 1.1. > > A great deal of internal cleanup has happened in > commons-validator since > its 1.0.2 release as well as new features and a more extensible > definition. I think Rob Leland is planning on getting a 1.1 > release out > soon. > > David Cool! My company won't let me ship with nightly builds, but, I'd be glad to test release candidates for an upcoming release against my webapp. If the timing was right, I might even be able to include the new release in my current project before it gets deployed. That won't be happening until the November/December timeframe. Thanks, Van - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using Struts Validator on Map-backed ActionForms
Just forgot to explain that I do the following: mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 11:44 AM To: 'Struts Users Mailing List' Subject: RE: Using Struts Validator on Map-backed ActionForms Hi Panchasheel, I am working with map backed action forms and the way to work with validation in this case is as follows (a piece of my validation.xml): (on my ActionForm there are getProperty and setProperty interfacing the actual map - as in your case I guess it is 'getVolume() and setVolume()). mask ${username} Hope this helps, Erez -Original Message- From: Gandle, Panchasheel [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 4:48 AM To: 'Struts Users Mailing List' Subject: RE: Using Struts Validator on Map-backed ActionForms Has anybody come up with any validations for map-backed fields what should go in ??? for <% for (int i=0;i<5;i++;) { %> <% } %> Thanks Panchasheel -Original Message- From: Cordingley, Charles [mailto:[EMAIL PROTECTED] Sent: Friday, August 01, 2003 1:24 PM To: '[EMAIL PROTECTED]' Subject: Using Struts Validator on Map-backed ActionForms Hi, I am trying to use the Struts Validator to generate Javascript validation on a Map-backed action form, but I keep getting "type is null or not an object" javascript error (I am using Struts 1.1). Non map-backed properties on the form work fine. In the JSP I am creating text boxes using: and have this method on the action form to get it: public void setVolume(String key, Object value) { volumes.put(key, value); } In the validation.xml I have tried: and: but both result in the error. Does anyone know how to do this? Thanks, Charles. The Royal Bank of Scotland plc ('the Bank') is regulated by the Financial Services Authority and is a member of The Royal Bank of Scotland Marketing Group. The only packaged products (life policies, unit trusts and other collective investment schemes and stakeholder and other pensions) the Bank advises on and sells are those of the Marketing Group, whose other members are Royal Scottish Assurance plc and Royal Bank of Scotland Unit Trust Management Limited, both regulated by the Financial Services Authority. The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. Agency agreements exist between members of The Royal Bank of Scotland Group. This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for changes made to this message after it was sent. Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by The Royal Bank of Scotland plc in this regard and the recipient should carry out such virus and other checks as it considers appropriate. - 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]
Re: Struts Validator Javascript
> ... Am I so special :) ;-) If I remember it well, it's an open issue in the bug-list. cheers Reinhard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]