Re: Validation Problems
I had the same problem. The solution was that my webapp was not using: jakarta-oro.jar which is a regular expression package used by some, but not all, of the validations. - Charlie Dear Struts users, I have done a simple web-app using validator framework. the JavaScript validations are proper.But in the server side validations, i have problems. Only,the 'required','minlength''maxlength' validations are working.Rest other validators have no effect even though, i have used them in the validation.xml file. eg- validate email-address has no effect even if i enter a invalid email-address. In javascript validations, if I enter a invalid email-id , I am getting a error,whereas in server side there is no error shown. Here is my validation.xml file . form-validation formset formname=registrationForm fieldproperty=username depends=required,mask,minlength msg name=mask key=loginform.username.invalid/ arg0 key=loginform.username.displayname/ arg1 name=minlength key=${var:minlength} resource=false/ var var-namemask/var-name var-value^\w+$/var-value /var var var-nameminlength/var-name var-value5/var-value /var /field fieldproperty=password1 depends=required arg0 key=loginform.password1.displayname/ /field fieldproperty=password2 depends=required arg0 key=loginform.password2.displayname/ /field fieldproperty=phone depends=required arg0 key=loginform.phone.displayname/ /field fieldproperty=email depends=required,email arg0 key=loginform.email.displayname/ /field /form /formset /form-validation Please,tell me what would be the problem and how to solve it. Get your own 800 number Voicemail, fax, email, and a lot more http://www.ureach.com/reg/tag - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation Problems
Dhruva B. Reddy wrote: I am trying to validate a form that includes, among other things, a checkbox and a text field that contains a credit card number. The nightly build of struts now handles checkboxes, select's, radio buttons. I specify that the checkbox is required. I assume this means this means the checkbox must be checked in order for validation to succeed? However, validation for the form succeeds without this. Here is the code from validation.xml: field property=termsAccepted depends=required msg name=required key=errors.required/ arg0 key=bookingActionForm.termsAccepted/ /field Also, the credit card validation succeeds no matter what I put in for that field. Here is the code I have for that: field property=ccNumber depends=required,creditCard msg name=required key=errors.required/ msg name=creditCard key=errors.creditcard/ arg0 key=bookingActionForm.ccNumber/ /field (it does complain when I leave this field blank). Can anyone tell me what I might be doing wrong? Thanks, -d __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.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: Validation Problems
Websphere 5 has a nice struts-config UI that helps to keep everything organized. I've heard of other UI's out there too. - Keith -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 02, 2003 5:26 PM To: Struts Users Mailing List Subject: Re: Validation Problems --- Adam Hardy [EMAIL PROTECTED] wrote: What is it about action mappings? People seem to think they cost money or something. Every struts project I've done had hundreds. If you need two action mappings, don't worry about it. I think somebody worked out once that tomcat would only start to show performance degradation once the action mappings total reached 100,000. I suppose you have to make sure you keep them grouped together in struts-config.xml to stop the file getting unmanageable, but that's the only disadvantage I can think of. You can use multiple struts-config.xml files to cleanly group your definitions. David As far as I'm concerned, I'd always rather change some config statement than change code and recompile. But your action error is playing up still right? I presume if you take the html:errors tag out of the jsp, there is no exception? Post the tag here. Also, check your application resources file for the error messages, the header and the footer. Adam Nathan Ewing wrote: Upgraded, didn't help. Nathan --- Nathan Ewing [EMAIL PROTECTED] wrote: Actually version 1.1.b3 Maybe I should try the final release. Nathan --- Wendy Smoak [EMAIL PROTECTED] wrote: Nathan wrote: I'm trying to set up struts validation (using the validate() function in the actionForm) and I'm getting a few problems. First, as soon as I open the form it shows the validation errors. It doesn't wait until I fill out the form. Is there a way to prevent this? Search the archives, this has come up before. One way is to override the 'validate' method and only call super.validate() when appropriate. Second if I fill out the form correctly (and hence there would be no validation errors) I get a null pointer exception on the: org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:239) tag. What version of Struts? I am not seeing this behavior at all. -- 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.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: Validation Problems
Nathan Ewing wrote: I'm trying to set up struts validation (using the validate() function in the actionForm) and I'm getting a few problems. First, as soon as I open the form it shows the validation errors. It doesn't wait until I fill out the form. Is there a way to prevent this? yes sure, you set up another action mapping for the initial call of the form, exactly the same except with validation = false Second if I fill out the form correctly (and hence there would be no validation errors) I get a null pointer exception on the: org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:239) tag don't know about that. what have you got for the tag? if you set up the initial mapping as above, do you still get it? Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation Problems
I did as you suggested and it doesn't show the validation errors the first time (although I'm a bit disappointed I have to do 2 separate actions just for the same thing. Now if I hit submit I get the nullpointer exception regardless of whether I fill in the form correctly or not. Nathan --- Adam Hardy [EMAIL PROTECTED] wrote: Nathan Ewing wrote: I'm trying to set up struts validation (using the validate() function in the actionForm) and I'm getting a few problems. First, as soon as I open the form it shows the validation errors. It doesn't wait until I fill out the form. Is there a way to prevent this? yes sure, you set up another action mapping for the initial call of the form, exactly the same except with validation = false Second if I fill out the form correctly (and hence there would be no validation errors) I get a null pointer exception on the: org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:239) tag don't know about that. what have you got for the tag? if you set up the initial mapping as above, do you still get it? Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validation Problems
Nathan wrote: I'm trying to set up struts validation (using the validate() function in the actionForm) and I'm getting a few problems. First, as soon as I open the form it shows the validation errors. It doesn't wait until I fill out the form. Is there a way to prevent this? Search the archives, this has come up before. One way is to override the 'validate' method and only call super.validate() when appropriate. Second if I fill out the form correctly (and hence there would be no validation errors) I get a null pointer exception on the: org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:239) tag. What version of Struts? I am not seeing this behavior at all. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM
RE: Validation Problems
Actually version 1.1.b3 Maybe I should try the final release. Nathan --- Wendy Smoak [EMAIL PROTECTED] wrote: Nathan wrote: I'm trying to set up struts validation (using the validate() function in the actionForm) and I'm getting a few problems. First, as soon as I open the form it shows the validation errors. It doesn't wait until I fill out the form. Is there a way to prevent this? Search the archives, this has come up before. One way is to override the 'validate' method and only call super.validate() when appropriate. Second if I fill out the form correctly (and hence there would be no validation errors) I get a null pointer exception on the: org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:239) tag. What version of Struts? I am not seeing this behavior at all. -- 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: Validation Problems
Upgraded, didn't help. Nathan --- Nathan Ewing [EMAIL PROTECTED] wrote: Actually version 1.1.b3 Maybe I should try the final release. Nathan --- Wendy Smoak [EMAIL PROTECTED] wrote: Nathan wrote: I'm trying to set up struts validation (using the validate() function in the actionForm) and I'm getting a few problems. First, as soon as I open the form it shows the validation errors. It doesn't wait until I fill out the form. Is there a way to prevent this? Search the archives, this has come up before. One way is to override the 'validate' method and only call super.validate() when appropriate. Second if I fill out the form correctly (and hence there would be no validation errors) I get a null pointer exception on the: org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:239) tag. What version of Struts? I am not seeing this behavior at all. -- 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: Validation Problems
--- Adam Hardy [EMAIL PROTECTED] wrote: What is it about action mappings? People seem to think they cost money or something. Every struts project I've done had hundreds. If you need two action mappings, don't worry about it. I think somebody worked out once that tomcat would only start to show performance degradation once the action mappings total reached 100,000. I suppose you have to make sure you keep them grouped together in struts-config.xml to stop the file getting unmanageable, but that's the only disadvantage I can think of. You can use multiple struts-config.xml files to cleanly group your definitions. David As far as I'm concerned, I'd always rather change some config statement than change code and recompile. But your action error is playing up still right? I presume if you take the html:errors tag out of the jsp, there is no exception? Post the tag here. Also, check your application resources file for the error messages, the header and the footer. Adam Nathan Ewing wrote: Upgraded, didn't help. Nathan --- Nathan Ewing [EMAIL PROTECTED] wrote: Actually version 1.1.b3 Maybe I should try the final release. Nathan --- Wendy Smoak [EMAIL PROTECTED] wrote: Nathan wrote: I'm trying to set up struts validation (using the validate() function in the actionForm) and I'm getting a few problems. First, as soon as I open the form it shows the validation errors. It doesn't wait until I fill out the form. Is there a way to prevent this? Search the archives, this has come up before. One way is to override the 'validate' method and only call super.validate() when appropriate. Second if I fill out the form correctly (and hence there would be no validation errors) I get a null pointer exception on the: org.apache.struts.taglib.html.ErrorsTag.doStartTag(ErrorsTag.java:239) tag. What version of Struts? I am not seeing this behavior at all. -- 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validation problems
I figured out my problem. Thanks, Kent -Original Message-From: Kent Roylance [mailto:[EMAIL PROTECTED]]Sent: Monday, July 30, 2001 6:09 AMTo: [EMAIL PROTECTED]Subject: Validation problems I maybe taking the wrong approach with Struts where rather than creating an attribute for every tag html:text inputin the form for a web page, I create and and use an object that has all those attributes and store that object in the session. I have been able to get everything to work except when I validate and get a validation error. When I get the validation error in the web page, its wipes out all my attributes. Has anyone else ran into this problem? Appreciate any help, Kent