Re: DispatchAction descendant and Struts Validator problems
Just FYI, I found a post in the newsgroup archives that solved my problems. The author's name eludes me, but he's certainly sharp. All one must do is set validate to false for the action mapping in the struts-config.xml and then, in the methods in which one wishes to validate, call something like: protected boolean isFormValid(HttpServletRequest request, ActionMapping mapping, ActionErrors errors, ActionForm form) { DynaValidatorForm dvForm = (DynaValidatorForm) form; errors.add(dvForm.validate(mapping, request)); if (!errors.isEmpty()) { saveErrors(request, errors); return false; } else return true; } } Simple fix from a very helpful newsgroup, Tony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DispatchAction descendant and Struts Validator problems
Hey all, I'm having trouble getting some simple Validator required fields working on a DynaValidatorForm being used in an Action extending a descendant of DispatchAction. The action is attached, but it behaves something like this: Dispatch method: read - Reads information from an oracle database to populate a multipurpose Tiles form that is used both for adding and editing the model. First, get the itemID (primary key) from the request or session. Next, save a transaction token to the request. Next, read the associated data from the database and use the Commons-BeanUtils to map the returned business object to the DynaValidatorForm. Next, set the dispatch field on the DynaValidatorForm to edit so that my multipurpose Tile jsp form knows to what dispatch action to submit. Lastly, forward to the Tileset. Dispatch method: edit - Performs an update on the model using the submitted DynaValidatorForm. First, make sure the user has seen the multipurpose Tile jsp form by checking to see if the DynaValidatorForm maintains a true value for its seenForm element. Next, check the sync token to make sure there was no duplicate form resubmission. Next, pass the map .getMap() of the DynaValidatorForm to update the model. Lastly, forward to a success page. Dispatch method: add - Adds an item to the model. First, make sure the user has seen the multipurpose Tile jsp form by checking to see if the DynaValidatorForm maintains a true value for its seenForm element. If not, set a sync request token and forward to the tile set. If so, check the sync token and isCancelled for validity. Next, use the .getMap() of the DynaValidatorForm to insert an item into the model. Lastly, forward to a success page. I want validation to occur on add and on edit but not on read. My problem, it seems, is that the validator architecture validates all form submissions to the DispatchAction, regardless of the method parameter provided. Is there any way to validate only specific methods of a dispatch action? I suppose that I may need to break my add method into a pre-add and an add to only validate add submissions, but other than that, I can't see why this should be so difficult for me to figure out. Disposing of DispatchActions entirely might work, but it is less than ideal in a code-reuse and elegance POV. And no, I'm not looking to start an elegance holy war. I'm just a simple intern. Incidentally, I devised a little hack to have the unspecified method called if introspection doesn't find a public method by the value provided with your dispatch request param. Maybe I'm mistaken, but it seemed like unspecified was only called when the dispath parameter was null. That's not ideal for silly users that putz with the querystring. First, subclass DispatchAction and make unspecified public rather than protected when you implement it. Next, replace getMethod(String name) with: protected Method getMethod(String name) throws NoSuchMethodException { synchronized (methods) { Method method = (Method) methods.get(name); if (method == null) { try { method = clazz.getMethod(name, types); methods.put(name, method); } catch (NoSuchMethodException nsme) { method = clazz.getMethod(unspecified, types); } } return (method); } } Anyway, any help would be great, Tony begin 666 CruCompoundAction.java M%C:V%G92!C;VTN9IF5R+F-U9YA8W1I;VYS+F-R=3L-@T*:6UP;W)T M(]R9RYA%C:4NW1R=71S+F%C=EO;BY!8W1I;VY-87!P:6YG.PT*:6UP M;W)T(]R9RYA%C:4NW1R=71S+F%C=EO;BY!8W1I;VY;W)M.PT*:6UP M;W)T(]R9RYA%C:4NW1R=71S+F%C=EO;BY!8W1I;VY;W)W87)D.PT* M:6UP;W)T(]R9RYA%C:4NW1R=71S+F%C=EO;BY!8W1I;VY%G)OCL- MFEM]R=!OFN87!A8VAE+G-TG5TRYA8W1I;VXN06-T:6]N17)R;W)S M.PT*:6UP;W)T(]R9RYA%C:4NW1R=71S+F%C=EO;BY!8W1I;VY-97-S M86=E.PT*:6UP;W)T(]R9RYA%C:4NW1R=71S+F%C=EO;BY!8W1I;VY- M97-S86=ESL-FEM]R=!J879AYS97)V;5T+FAT=' N2'1T%-EG9L M971297%U97-T.PT*:6UP;W)T(IA=F%X+G-EG9L970N:'1TY(='1P4V5R M=FQE=%)EW!O;G-E.PT*#0II;7!OG0@:F%V82YU=EL+DUA#L-@T*:6UP M;W)T(]R9RYA%C:4NW1R=71S+G9A;ED871OBY$6YA5F%L:61A=]R M1F]R;3L-@T*:6UP;W)T(]R9RYA%C:4N8V]M;6]NRYB96%N=71I;',N M0F5A;E5T:6QS.PT*#0II;7!O[EMAIL PROTECTED]:7IEBYC=60N=71I;Y4;VME M;CL-FEM]R=!C;VTN9IF5R+F-U9YU=EL+D-O;7!O=6YD260[#0II M;7!O[EMAIL PROTECTED]:7IEBYC=60N;6]D96PN36]D96Q!8V-EW-%-E'1I M;VX[#0II;7!O[EMAIL PROTECTED]:7IEBYC=60N;6]D96PN36]D96Q!91!8V-E MW,[#0II;7!O[EMAIL PROTECTED]:7IEBYC=60N;6]D96PN36]D96Q296%D06-C M97-S.PT*:6UP;W)T(-O;2YP9FEZ97(N8W5D+FUO95L+DUO95L161I=$%C M8V5SSL-@T*+RH-B D3]G.B!#G5#;VUP;W5N9$%C=EO;BYJ879A+'8@ M) T*(%)E=FES:6]N(#$N-R @,C P,R\P-R\R,2 Q-3HP.#HS-B @EN=5R M80T*(HJ*B!E;7!T2!L;V@;65SV%G92 J*BH-@T*(%)E=FES:6]N(#$N M-B @,C P,R\P-R\Q-R Q.3HU,CHT-2 @EN=5R80T*(HJ*B!E;7!T2!L M;V@;65SV%G92 J*BH-@T*(%)E=FES:6]N(#$N-2 @,C P,R\P-R\Q- R M,#HQ-CHS.2 @EN=5R80T*(HJ*B!E;7!T2!L;V@;65SV%G92 J*BH- M@T*(%)E=FES:6]N(#$N- @,C P,R\P-R\Q- Q.#HR,3HU-B @EN=5R M80T*(HJ*B!E;7!T2!L;V@;65SV%G92 J*BH-@T*(%)E=FES:6]N(#$N M,R @,C P,R\P-R\Q, R,#HQ-#HP.2
Struts 1.1 RC1 - Validator problems on Linux only
Hi, we've been developing an application with Struts 1.1 RC1 which runs fine on Win 2000 machines. Today we deployed it to a Linux machine (Red Hat, JDK 1.4.1_01, Tomcat 4.1.12) and found out that the validator didn't work as expected, i. e. validation simply never failed. So I decided to attach to the VM and debug into the code. To do so, I needed the validator sources which, unfortunately, are not part of the Struts source distribution. So, I used the latest nightly build of the validator, attached to the process in order to debug into it, and, guess what, now it worked. So, I really wonder what this was. Has anybody else experienced such behavior? Are there any Linux-specific issues? Thanks, Reinhard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts 1.1 RC1 - Validator problems on Linux only
ensure you ve got the very last version of commons-validator in fact, with the commons validator bundled with 1.1RC1, there is a bug when the machine has no connection to the Internet for more information, have a look to the bug database. regards Guillaume Compagnon -Message d'origine- De: Reinhard Nägele [SMTP:[EMAIL PROTECTED] Date: vendredi 21 mars 2003 11:07 À:[EMAIL PROTECTED] Objet:Struts 1.1 RC1 - Validator problems on Linux only Hi, we've been developing an application with Struts 1.1 RC1 which runs fine on Win 2000 machines. Today we deployed it to a Linux machine (Red Hat, JDK 1.4.1_01, Tomcat 4.1.12) and found out that the validator didn't work as expected, i. e. validation simply never failed. So I decided to attach to the VM and debug into the code. To do so, I needed the validator sources which, unfortunately, are not part of the Struts source distribution. So, I used the latest nightly build of the validator, attached to the process in order to debug into it, and, guess what, now it worked. So, I really wonder what this was. Has anybody else experienced such behavior? Are there any Linux-specific issues? Thanks, Reinhard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Ce message et toutes les pieces jointes (ci-apres le message) sont confidentiels et etablis a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite.Tout message electronique est susceptible d'alteration. Le CREDIT DU NORD et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie. This message and any attachments ( the message) are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited.E-mails are susceptible to alteration. Neither CREDIT DU NORD nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 1.1 RC1 - Validator problems on Linux only
Thanks for the info. I guess, the Internet connection was the problem then. I searched the bug database but couldn't find this. I'll check again. Reinhard COMPAGNON GUILLAUME wrote: ensure you ve got the very last version of commons-validator in fact, with the commons validator bundled with 1.1RC1, there is a bug when the machine has no connection to the Internet for more information, have a look to the bug database. regards Guillaume Compagnon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts 1.1 RC1 - Validator problems on Linux only
this is the bug: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17470 -Message d'origine- De: Reinhard Nägele [SMTP:[EMAIL PROTECTED] Date: vendredi 21 mars 2003 11:52 À:Struts Users Mailing List Objet:Re: Struts 1.1 RC1 - Validator problems on Linux only Thanks for the info. I guess, the Internet connection was the problem then. I searched the bug database but couldn't find this. I'll check again. Reinhard COMPAGNON GUILLAUME wrote: ensure you ve got the very last version of commons-validator in fact, with the commons validator bundled with 1.1RC1, there is a bug when the machine has no connection to the Internet for more information, have a look to the bug database. regards Guillaume Compagnon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Ce message et toutes les pieces jointes (ci-apres le message) sont confidentiels et etablis a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite.Tout message electronique est susceptible d'alteration. Le CREDIT DU NORD et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie. This message and any attachments ( the message) are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited.E-mails are susceptible to alteration. Neither CREDIT DU NORD nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validator Problems
Hey all, i've problems with my validator: 30.01.2003 19:27:39 org.apache.struts.validator.ValidatorActionForm validate SCHWERWIEGEND: Resources not defined for Validator org.apache.commons.validator.ValidatorException: Resources not defined for Validator at org.apache.commons.validator.Validator.validate(Validator.java:545) See attached files for my configuration... thanks Fredy ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE form-validation PUBLIC -//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN http://jakarta.apache.org/commons/dtds/validator_1_0.dtd; form-validation global constant constant-namephone/constant-name constant-value^\(?(\d{3})\)?[-| ]?(\d{3})[-| ]?(\d{4})$/constant-value /constant constant constant-namezip/constant-name constant-value^\d{5}\d*$/constant-value /constant /global formset constant constant-namezip/constant-name constant-value^\d{5}(-\d{4})?$/constant-value /constant formname=showpersonForm fieldproperty=birthday depends=required arg0 key=typeForm.date.displayname/ var var-namedatePatternStrict/var-name var-valueMM.dd./var-value /var /field /form /formset /form-validation ?xml version=1.0 encoding=UTF-8? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd; struts-config !-- == Data Source Configuration === -- data-sources data-source set-property property=password value= / set-property property=minCount value=1 / set-property property=maxCount value=5 / set-property property=user value= / set-property property=driverClass value=com.mysql.jdbc.Driver / set-property property=description value=jaxsdb Datasourse / set-property property=url value=jdbc:mysql://localhost/jaxsdb / set-property property=readOnly value=false / set-property property=autoCommit value=false / set-property property=loginTimeout value=60 / set-property property=key value=jaxs / /data-source /data-sources !-- == Form Bean Definitions == -- form-beans type=org.apache.struts.action.ActionFormBean form-bean name=logonForm type=de.hauschel.wapen.struts.form.LogonForm form-property name=password type=java.lang.String / form-property name=username type=java.lang.String / /form-bean form-bean name=listpersonsForm type=de.hauschel.wapen.struts.form.ListpersonsForm / form-bean name=showpersonForm type=de.hauschel.wapen.struts.form.ShowpersonForm form-property name=sex type=java.lang.String / form-property name=age type=java.lang.Integer / form-property name=identificationNumber type=java.lang.String / form-property name=title type=java.lang.String / form-property name=taxNumber type=java.lang.String / form-property name=nationality type=java.lang.String / form-property name=secondName type=java.lang.String / form-property name=nickName type=java.lang.String / form-property name=birthday type=java.util.Date / /form-bean form-bean name=savepersonForm type=de.hauschel.wapen.struts.form.SavepersonForm / /form-beans !-- == Global Exception Definitions == -- global-exceptions / !-- == Global Forward Definitions === -- global-forwards type=org.apache.struts.action.ActionForward forward name=login path=/form/logon.jsp / /global-forwards !-- == Action Mapping Definitions === -- action-mappings type=org.apache.struts.action.ActionMapping action attribute=logonForm input=/form/logon.jsp name=logonForm path=/logon type=de.hauschel.wapen.struts.action.LogonAction forward name=success path=/listpersons.do / /action action attribute=listpersonsForm input=/form/listpersons.jsp name=listpersonsForm path=/listpersons type=de.hauschel.wapen.struts.action.ListpersonsAction forward name=success path=/form/listpersons.jsp / /action action attribute=showpersonForm input=/form/showperson.jsp name=showpersonForm
RE: Validator Problems
Your struts-config doesn't have a plug-in element for the Validator. Sri -Original Message- From: Softwareentwicklung Hauschel [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 1:33 PM To: Struts Users Mailing List Subject: Validator Problems Hey all, i've problems with my validator: 30.01.2003 19:27:39 org.apache.struts.validator.ValidatorActionForm validate SCHWERWIEGEND: Resources not defined for Validator org.apache.commons.validator.ValidatorException: Resources not defined for Validator at org.apache.commons.validator.Validator.validate(Validator.java:545) See attached files for my configuration... thanks Fredy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Losing my sanity: 1.1b Validator problems
I inserted the javascript-tag and all I got in the html-file was : // End -- /SCRIPT All my validations are in this XML-file: form-validation !-- == Global Validation Definitions == -- formset form name=loginForm field property=username depends=required arg0 key=login.password/ /field field property=password depends=required arg0 key=login.username/ /field /form /formset /form-validation That's all. I know that problems occur when I introduced Tiles-Definitions into my webapp. I don't know how to go on or either where to look for the error! Can anyone help ;-? Ralf out of my struts-config.xml: form-beans form-bean name = loginForm dynamic = true type = org.apache.struts.validator.DynaValidatorForm form-property name = username type = java.lang.String / form-property name = password type = java.lang.String / /form-bean /form-beans action-mappings action path=/login type=de.subsist.zeiterfassung.controller.actions.LoginAction scope=request name=loginForm validate=true input=/security/login.jsp forward name=Success path=/secureZone/inside.jsp redirect=true/ forward name=Failure path=/security/login.jsp redirect=false/ /action /action-mappings plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathname value=/WEB-INF/conf/validator-rules.xml/ set-property property=pathname value=/WEB-INF/conf/validator.xml/ /plug-in plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/conf/tiles-defs.xml / set-property property=definitions-debug value=2 / set-property property=definitions-parser-details value=2 / set-property property=definitions-parser-validate value=true / /plug-in - Original Message - From: Richards, Devin N (Devin) [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 6:17 PM Subject: RE: Losing my sanity: 1.1b Validator problems You have all of your validations in the XML? Have you tried adding the html:javascript formName=yourForm to the JSP page to see if the validation is working correctly? Once you have this you can view source and see the validation code it generated. This will show you if the validator plug-in is setup correctly and that your XML is correct. BTW: we are most likely going to production on 1.1-b2 Good luck. -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 12:13 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Losing my sanity: 1.1b Validator problems Devin, thanks for further the further explanation. I replied to your previous email earlier this morning, but it seems to have been lost in the ether. Anyway, I also tried including super.validate() in my form bean, which confirmed that Validation is in fact being done. The mystery is why validation is being performed but control is never returned to the JSP. It simply dies. No error. Nothing. I didn't change anything in the code when moving to 1.1b, so am beginning to wonder if this is a bug of some sort. I've spent way too many hours trying to track down the problem and may have to just go back to 1.1a if I can't find a solution today. Thanks again for the help. Andrew On Wednesday, August 21, 2002, at 10:16 AM, Richards, Devin N (Devin) wrote: I had some validation that was done in the validation.xml (required/minlenght etc) and then I wanted to do some business rule validation that I could not do in the XML. When I put the code into my form bean's validate() method, I got all of the business validations, but none of my basic required/minlenght validations that were done in the XML. Once I added a call to super.validate() it picked them up. Here is part of the struts-config.xml: action path=/rmaFormSubmit name=rmaForm type=com.lucent.portal.rma.RmaFormAction input=rmaFormDef scope=request parameter=submit validate=true forward name=continue path=rmaAckDef / /action plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml, /WEB-INF/classes/com/lucent/portal/rma/RmaValidation.xml / /plug-in The rmaAckDef as well as rmaFormDef are Tiles definations. Here is part of RmaValidation.xml: formset form name=rmaForm field property=companyName depends=required arg0 key=label.companyName / /field field property=firstName depends=required arg0 key=label.firstName / /field /formset For these validations I use the html:javascript tag in the form JSP to catch all normal validations before
Re: Losing my sanity: 1.1b Validator problems
Hi Ralf, try this, it should work - plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/conf/validator-rules.xml,/WEB-INF/conf/validator.xml/ /plug-in in struts1.1b2 , multiple declaration of set-property is not allowed. Amit. - Original Message - From: Ralf Lorenz [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, August 22, 2002 2:50 PM Subject: Re: Losing my sanity: 1.1b Validator problems I inserted the javascript-tag and all I got in the html-file was : // End -- /SCRIPT All my validations are in this XML-file: form-validation !-- == Global Validation Definitions == -- formset form name=loginForm field property=username depends=required arg0 key=login.password/ /field field property=password depends=required arg0 key=login.username/ /field /form /formset /form-validation That's all. I know that problems occur when I introduced Tiles-Definitions into my webapp. I don't know how to go on or either where to look for the error! Can anyone help ;-? Ralf out of my struts-config.xml: form-beans form-bean name = loginForm dynamic = true type = org.apache.struts.validator.DynaValidatorForm form-property name = username type = java.lang.String / form-property name = password type = java.lang.String / /form-bean /form-beans action-mappings action path=/login type=de.subsist.zeiterfassung.controller.actions.LoginAction scope=request name=loginForm validate=true input=/security/login.jsp forward name=Success path=/secureZone/inside.jsp redirect=true/ forward name=Failure path=/security/login.jsp redirect=false/ /action /action-mappings plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathname value=/WEB-INF/conf/validator-rules.xml/ set-property property=pathname value=/WEB-INF/conf/validator.xml/ /plug-in plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/conf/tiles-defs.xml / set-property property=definitions-debug value=2 / set-property property=definitions-parser-details value=2 / set-property property=definitions-parser-validate value=true / /plug-in - Original Message - From: Richards, Devin N (Devin) [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 6:17 PM Subject: RE: Losing my sanity: 1.1b Validator problems You have all of your validations in the XML? Have you tried adding the html:javascript formName=yourForm to the JSP page to see if the validation is working correctly? Once you have this you can view source and see the validation code it generated. This will show you if the validator plug-in is setup correctly and that your XML is correct. BTW: we are most likely going to production on 1.1-b2 Good luck. -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 12:13 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Losing my sanity: 1.1b Validator problems Devin, thanks for further the further explanation. I replied to your previous email earlier this morning, but it seems to have been lost in the ether. Anyway, I also tried including super.validate() in my form bean, which confirmed that Validation is in fact being done. The mystery is why validation is being performed but control is never returned to the JSP. It simply dies. No error. Nothing. I didn't change anything in the code when moving to 1.1b, so am beginning to wonder if this is a bug of some sort. I've spent way too many hours trying to track down the problem and may have to just go back to 1.1a if I can't find a solution today. Thanks again for the help. Andrew On Wednesday, August 21, 2002, at 10:16 AM, Richards, Devin N (Devin) wrote: I had some validation that was done in the validation.xml (required/minlenght etc) and then I wanted to do some business rule validation that I could not do in the XML. When I put the code into my form bean's validate() method, I got all of the business validations, but none of my basic required/minlenght validations that were done in the XML. Once I added a call to super.validate() it picked them up. Here is part of the struts-config.xml: action path=/rmaFormSubmit name=rmaForm type=com.lucent.portal.rma.RmaFormAction input=rmaFormDef scope=request parameter=submit validate=true forward name=continue path=rmaAckDef / /action plug-in className
Re: Losing my sanity: 1.1b Validator problems
thanks Amit, that's the problem. it's allways such a little thing. Ralf - Original Message - From: Amit Badheka [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, August 22, 2002 11:32 AM Subject: Re: Losing my sanity: 1.1b Validator problems Hi Ralf, try this, it should work - plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/conf/validator-rules.xml,/WEB-INF/conf/validator.xml/ /plug-in in struts1.1b2 , multiple declaration of set-property is not allowed. Amit. - Original Message - From: Ralf Lorenz [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, August 22, 2002 2:50 PM Subject: Re: Losing my sanity: 1.1b Validator problems I inserted the javascript-tag and all I got in the html-file was : // End -- /SCRIPT All my validations are in this XML-file: form-validation !-- == Global Validation Definitions == -- formset form name=loginForm field property=username depends=required arg0 key=login.password/ /field field property=password depends=required arg0 key=login.username/ /field /form /formset /form-validation That's all. I know that problems occur when I introduced Tiles-Definitions into my webapp. I don't know how to go on or either where to look for the error! Can anyone help ;-? Ralf out of my struts-config.xml: form-beans form-bean name = loginForm dynamic = true type = org.apache.struts.validator.DynaValidatorForm form-property name = username type = java.lang.String / form-property name = password type = java.lang.String / /form-bean /form-beans action-mappings action path=/login type=de.subsist.zeiterfassung.controller.actions.LoginAction scope=request name=loginForm validate=true input=/security/login.jsp forward name=Success path=/secureZone/inside.jsp redirect=true/ forward name=Failure path=/security/login.jsp redirect=false/ /action /action-mappings plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathname value=/WEB-INF/conf/validator-rules.xml/ set-property property=pathname value=/WEB-INF/conf/validator.xml/ /plug-in plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/conf/tiles-defs.xml / set-property property=definitions-debug value=2 / set-property property=definitions-parser-details value=2 / set-property property=definitions-parser-validate value=true / /plug-in - Original Message - From: Richards, Devin N (Devin) [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 6:17 PM Subject: RE: Losing my sanity: 1.1b Validator problems You have all of your validations in the XML? Have you tried adding the html:javascript formName=yourForm to the JSP page to see if the validation is working correctly? Once you have this you can view source and see the validation code it generated. This will show you if the validator plug-in is setup correctly and that your XML is correct. BTW: we are most likely going to production on 1.1-b2 Good luck. -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 12:13 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Losing my sanity: 1.1b Validator problems Devin, thanks for further the further explanation. I replied to your previous email earlier this morning, but it seems to have been lost in the ether. Anyway, I also tried including super.validate() in my form bean, which confirmed that Validation is in fact being done. The mystery is why validation is being performed but control is never returned to the JSP. It simply dies. No error. Nothing. I didn't change anything in the code when moving to 1.1b, so am beginning to wonder if this is a bug of some sort. I've spent way too many hours trying to track down the problem and may have to just go back to 1.1a if I can't find a solution today. Thanks again for the help. Andrew On Wednesday, August 21, 2002, at 10:16 AM, Richards, Devin N (Devin) wrote: I had some validation that was done in the validation.xml (required/minlenght etc) and then I wanted to do some business rule validation that I could not do in the XML. When I put the code into my form bean's validate() method, I got all of the business validations
RE: Losing my sanity: 1.1b Validator problems
I noticed that when I went to 1.1b2 I had to insert a call to super.validate() as the first line in my validate() code to pick up all of the validations I set in my validation.xml file. -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 20, 2002 8:09 PM To: Struts Users Mailing List Subject: Losing my sanity: 1.1b Validator problems I upgraded to Struts 1.1b last week (and to Tomcat 4.1.9 - which is great great stuff) and everything seemed to go fine. However, today, I was demonstrating my app to a friend when I noticed Validator validations were not being performed. I checked the logs and the validation configuration files are being loaded just fine, but still no validation errors were being caught. I also noticed in the archives mention of a change in the way the plugin is configured in struts- config.xml. I made the change in my struts-config.xml thinking that must have been the problem, but alas, things got worse! Now, when the ValidatorForm is posted to the server, nothing happens at all! After about 10 seconds of processing, the browser seems to receive an empty response. A blank document is all that's received. I checked the logs, and no exceptions are being thrown. I have checked everything I can think of 4 or 5 times, and don't know what else to do. This worked perfectly in 1.1a. Please help if you have any ideas. Thanks very much, Andrew registrationForm extends ValidatorForm actionpath=/registration/save type=com.myapp.action.RegistrationAction name=registrationForm validate=true parameter=save scope=request input=/registration.jsp forward name=failure path=/registration.jsp/ forward name=success path=/do/registration/confirm/ /action -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Losing my sanity: 1.1b Validator problems
Devin, can you please explain that a little further? The problem that Andrew describes sounds familiar to me. I started using struts1.1b with validator and everything worked fine, just using a DynaValidatorForm. But then when I introduced Tiles to my application the validation didn't take place. Although the ValidatorPlugIn was loaded and there was no Exception ( looking into the logs). It's just that it don't happen. I don't know what you mean by putting a super.validate() as the first line ... because I just use given validation-rules (required, minlength ...) and some DynaValidatorForms. Any help on that ;-? Ralf - Original Message - From: Richards, Devin N (Devin) [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 3:19 PM Subject: RE: Losing my sanity: 1.1b Validator problems I noticed that when I went to 1.1b2 I had to insert a call to super.validate() as the first line in my validate() code to pick up all of the validations I set in my validation.xml file. -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 20, 2002 8:09 PM To: Struts Users Mailing List Subject: Losing my sanity: 1.1b Validator problems I upgraded to Struts 1.1b last week (and to Tomcat 4.1.9 - which is great great stuff) and everything seemed to go fine. However, today, I was demonstrating my app to a friend when I noticed Validator validations were not being performed. I checked the logs and the validation configuration files are being loaded just fine, but still no validation errors were being caught. I also noticed in the archives mention of a change in the way the plugin is configured in struts- config.xml. I made the change in my struts-config.xml thinking that must have been the problem, but alas, things got worse! Now, when the ValidatorForm is posted to the server, nothing happens at all! After about 10 seconds of processing, the browser seems to receive an empty response. A blank document is all that's received. I checked the logs, and no exceptions are being thrown. I have checked everything I can think of 4 or 5 times, and don't know what else to do. This worked perfectly in 1.1a. Please help if you have any ideas. Thanks very much, Andrew registrationForm extends ValidatorForm actionpath=/registration/save type=com.myapp.action.RegistrationAction name=registrationForm validate=true parameter=save scope=request input=/registration.jsp forward name=failure path=/registration.jsp/ forward name=success path=/do/registration/confirm/ /action -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Losing my sanity: 1.1b Validator problems
I had some validation that was done in the validation.xml (required/minlenght etc) and then I wanted to do some business rule validation that I could not do in the XML. When I put the code into my form bean's validate() method, I got all of the business validations, but none of my basic required/minlenght validations that were done in the XML. Once I added a call to super.validate() it picked them up. Here is part of the struts-config.xml: action path=/rmaFormSubmit name=rmaForm type=com.lucent.portal.rma.RmaFormAction input=rmaFormDef scope=request parameter=submit validate=true forward name=continue path=rmaAckDef / /action plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml, /WEB-INF/classes/com/lucent/portal/rma/RmaValidation.xml / /plug-in The rmaAckDef as well as rmaFormDef are Tiles definations. Here is part of RmaValidation.xml: formset form name=rmaForm field property=companyName depends=required arg0 key=label.companyName / /field field property=firstName depends=required arg0 key=label.firstName / /field /formset For these validations I use the html:javascript tag in the form JSP to catch all normal validations before submit. Here is part of the RmaForm.java (extends ValidatorForm): public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { // // Do validations from XML ActionErrors errors = super.validate(mapping, request); // // Extended validation checking if(this.isDoa()) if(!checkDosOrderNumber()) errors.add(dosOrderNumber, new ActionError(rma.errors.form.dosOrderNumber)); return errors; } In order to get the validatios from RmaValidation.xml I had to put the call to super.validate(). HTH -Devin -Original Message- From: Ralf Lorenz [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 10:21 AM To: Struts Users Mailing List Subject: Re: Losing my sanity: 1.1b Validator problems Devin, can you please explain that a little further? The problem that Andrew describes sounds familiar to me. I started using struts1.1b with validator and everything worked fine, just using a DynaValidatorForm. But then when I introduced Tiles to my application the validation didn't take place. Although the ValidatorPlugIn was loaded and there was no Exception ( looking into the logs). It's just that it don't happen. I don't know what you mean by putting a super.validate() as the first line ... because I just use given validation-rules (required, minlength ...) and some DynaValidatorForms. Any help on that ;-? Ralf - Original Message - From: Richards, Devin N (Devin) [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 3:19 PM Subject: RE: Losing my sanity: 1.1b Validator problems I noticed that when I went to 1.1b2 I had to insert a call to super.validate() as the first line in my validate() code to pick up all of the validations I set in my validation.xml file. -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 20, 2002 8:09 PM To: Struts Users Mailing List Subject: Losing my sanity: 1.1b Validator problems I upgraded to Struts 1.1b last week (and to Tomcat 4.1.9 - which is great great stuff) and everything seemed to go fine. However, today, I was demonstrating my app to a friend when I noticed Validator validations were not being performed. I checked the logs and the validation configuration files are being loaded just fine, but still no validation errors were being caught. I also noticed in the archives mention of a change in the way the plugin is configured in struts- config.xml. I made the change in my struts-config.xml thinking that must have been the problem, but alas, things got worse! Now, when the ValidatorForm is posted to the server, nothing happens at all! After about 10 seconds of processing, the browser seems to receive an empty response. A blank document is all that's received. I checked the logs, and no exceptions are being thrown. I have checked everything I can think of 4 or 5 times, and don't know what else to do. This worked perfectly in 1.1a
Re: Losing my sanity: 1.1b Validator problems
Devin, since I don't have my own Forms but use DynaValidatorForm I tried the following. I called the DynaValidatorForm.validate(mapping, request) in the execute-method of the Action that the request should be send to after the validation took place and I don't get any errors (although I should). It doesn't make sense to extend DynaValidatorForm just to override the validate(...)-method with super.validate(...), does it? I've got a clou what the problem is! Any ideas how to get any further;-? Ralf - Original Message - From: Richards, Devin N (Devin) [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 5:16 PM Subject: RE: Losing my sanity: 1.1b Validator problems I had some validation that was done in the validation.xml (required/minlenght etc) and then I wanted to do some business rule validation that I could not do in the XML. When I put the code into my form bean's validate() method, I got all of the business validations, but none of my basic required/minlenght validations that were done in the XML. Once I added a call to super.validate() it picked them up. Here is part of the struts-config.xml: action path=/rmaFormSubmit name=rmaForm type=com.lucent.portal.rma.RmaFormAction input=rmaFormDef scope=request parameter=submit validate=true forward name=continue path=rmaAckDef / /action plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml, /WEB-INF/classes/com/lucent/portal/rma/RmaValidation.xml / /plug-in The rmaAckDef as well as rmaFormDef are Tiles definations. Here is part of RmaValidation.xml: formset form name=rmaForm field property=companyName depends=required arg0 key=label.companyName / /field field property=firstName depends=required arg0 key=label.firstName / /field /formset For these validations I use the html:javascript tag in the form JSP to catch all normal validations before submit. Here is part of the RmaForm.java (extends ValidatorForm): public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { // // Do validations from XML ActionErrors errors = super.validate(mapping, request); // // Extended validation checking if(this.isDoa()) if(!checkDosOrderNumber()) errors.add(dosOrderNumber, new ActionError(rma.errors.form.dosOrderNumber)); return errors; } In order to get the validatios from RmaValidation.xml I had to put the call to super.validate(). HTH -Devin -Original Message- From: Ralf Lorenz [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 10:21 AM To: Struts Users Mailing List Subject: Re: Losing my sanity: 1.1b Validator problems Devin, can you please explain that a little further? The problem that Andrew describes sounds familiar to me. I started using struts1.1b with validator and everything worked fine, just using a DynaValidatorForm. But then when I introduced Tiles to my application the validation didn't take place. Although the ValidatorPlugIn was loaded and there was no Exception ( looking into the logs). It's just that it don't happen. I don't know what you mean by putting a super.validate() as the first line ... because I just use given validation-rules (required, minlength ...) and some DynaValidatorForms. Any help on that ;-? Ralf - Original Message - From: Richards, Devin N (Devin) [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 3:19 PM Subject: RE: Losing my sanity: 1.1b Validator problems I noticed that when I went to 1.1b2 I had to insert a call to super.validate() as the first line in my validate() code to pick up all of the validations I set in my validation.xml file. -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 20, 2002 8:09 PM To: Struts Users Mailing List Subject: Losing my sanity: 1.1b Validator problems I upgraded to Struts 1.1b last week (and to Tomcat 4.1.9 - which is great great stuff) and everything seemed to go fine. However, today, I was demonstrating my app to a friend when I noticed Validator validations were not being performed. I checked the logs and the validation configuration files are being loaded just fine, but still no validation errors were being caught. I also noticed in the archives mention of a change in the way the plugin is configured in struts- config.xml. I made the change in my struts-config.xml thinking that must have been the problem, but alas, things got worse! Now, when the ValidatorForm is posted to the server, nothing happens at all! After about 10 seconds of processing, the browser seems to receive an empty response. A blank document is all that's received. I checked the logs, and no exceptions are being thrown. I have checked everything I can think of 4 or 5 times
Re: Losing my sanity: 1.1b Validator problems
Devin, thanks for further the further explanation. I replied to your previous email earlier this morning, but it seems to have been lost in the ether. Anyway, I also tried including super.validate() in my form bean, which confirmed that Validation is in fact being done. The mystery is why validation is being performed but control is never returned to the JSP. It simply dies. No error. Nothing. I didn't change anything in the code when moving to 1.1b, so am beginning to wonder if this is a bug of some sort. I've spent way too many hours trying to track down the problem and may have to just go back to 1.1a if I can't find a solution today. Thanks again for the help. Andrew On Wednesday, August 21, 2002, at 10:16 AM, Richards, Devin N (Devin) wrote: I had some validation that was done in the validation.xml (required/minlenght etc) and then I wanted to do some business rule validation that I could not do in the XML. When I put the code into my form bean's validate() method, I got all of the business validations, but none of my basic required/minlenght validations that were done in the XML. Once I added a call to super.validate() it picked them up. Here is part of the struts-config.xml: action path=/rmaFormSubmit name=rmaForm type=com.lucent.portal.rma.RmaFormAction input=rmaFormDef scope=request parameter=submit validate=true forward name=continue path=rmaAckDef / /action plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml, /WEB-INF/classes/com/lucent/portal/rma/RmaValidation.xml / /plug-in The rmaAckDef as well as rmaFormDef are Tiles definations. Here is part of RmaValidation.xml: formset form name=rmaForm field property=companyName depends=required arg0 key=label.companyName / /field field property=firstName depends=required arg0 key=label.firstName / /field /formset For these validations I use the html:javascript tag in the form JSP to catch all normal validations before submit. Here is part of the RmaForm.java (extends ValidatorForm): public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { // // Do validations from XML ActionErrors errors = super.validate(mapping, request); // // Extended validation checking if(this.isDoa()) if(!checkDosOrderNumber()) errors.add(dosOrderNumber, new ActionError(rma.errors.form.dosOrderNumber)); return errors; } In order to get the validatios from RmaValidation.xml I had to put the call to super.validate(). HTH -Devin -Original Message- From: Ralf Lorenz [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 10:21 AM To: Struts Users Mailing List Subject: Re: Losing my sanity: 1.1b Validator problems Devin, can you please explain that a little further? The problem that Andrew describes sounds familiar to me. I started using struts1.1b with validator and everything worked fine, just using a DynaValidatorForm. But then when I introduced Tiles to my application the validation didn't take place. Although the ValidatorPlugIn was loaded and there was no Exception ( looking into the logs). It's just that it don't happen. I don't know what you mean by putting a super.validate() as the first line ... because I just use given validation-rules (required, minlength ...) and some DynaValidatorForms. Any help on that ;-? Ralf - Original Message - From: Richards, Devin N (Devin) [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 3:19 PM Subject: RE: Losing my sanity: 1.1b Validator problems I noticed that when I went to 1.1b2 I had to insert a call to super.validate() as the first line in my validate() code to pick up all of the validations I set in my validation.xml file. -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 20, 2002 8:09 PM To: Struts Users Mailing List Subject: Losing my sanity: 1.1b Validator problems I upgraded to Struts 1.1b last week (and to Tomcat 4.1.9 - which is great great stuff) and everything seemed to go fine. However, today, I was demonstrating my app to a friend when I noticed Validator
RE: Losing my sanity: 1.1b Validator problems
I assume that you have all of your validations in your validation.xml and that the example validations work right? The DynaValidatorForm has a method called validate(ActionMapping, HttpServletRequest) which should be called automatically if you have validate=true in the action definition. I would not call this from your execute() method. While I have NO experience with the Dyna* classes I would think that they work much like the regular classes. You may want to try setting up a simple form using ValidatorForm and getting that to work, then try moving that to a Dyna, sorry I am out of ideas. -Devin -Original Message- From: Ralf Lorenz [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 12:00 PM To: Struts Users Mailing List Subject: Re: Losing my sanity: 1.1b Validator problems Devin, since I don't have my own Forms but use DynaValidatorForm I tried the following. I called the DynaValidatorForm.validate(mapping, request) in the execute-method of the Action that the request should be send to after the validation took place and I don't get any errors (although I should). It doesn't make sense to extend DynaValidatorForm just to override the validate(...)-method with super.validate(...), does it? I've got a clou what the problem is! Any ideas how to get any further;-? Ralf - Original Message - From: Richards, Devin N (Devin) [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 5:16 PM Subject: RE: Losing my sanity: 1.1b Validator problems I had some validation that was done in the validation.xml (required/minlenght etc) and then I wanted to do some business rule validation that I could not do in the XML. When I put the code into my form bean's validate() method, I got all of the business validations, but none of my basic required/minlenght validations that were done in the XML. Once I added a call to super.validate() it picked them up. Here is part of the struts-config.xml: action path=/rmaFormSubmit name=rmaForm type=com.lucent.portal.rma.RmaFormAction input=rmaFormDef scope=request parameter=submit validate=true forward name=continue path=rmaAckDef / /action plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml, /WEB-INF/classes/com/lucent/portal/rma/RmaValidation.xml / /plug-in The rmaAckDef as well as rmaFormDef are Tiles definations. Here is part of RmaValidation.xml: formset form name=rmaForm field property=companyName depends=required arg0 key=label.companyName / /field field property=firstName depends=required arg0 key=label.firstName / /field /formset For these validations I use the html:javascript tag in the form JSP to catch all normal validations before submit. Here is part of the RmaForm.java (extends ValidatorForm): public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { // // Do validations from XML ActionErrors errors = super.validate(mapping, request); // // Extended validation checking if(this.isDoa()) if(!checkDosOrderNumber()) errors.add(dosOrderNumber, new ActionError(rma.errors.form.dosOrderNumber)); return errors; } In order to get the validatios from RmaValidation.xml I had to put the call to super.validate(). HTH -Devin -Original Message- From: Ralf Lorenz [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 10:21 AM To: Struts Users Mailing List Subject: Re: Losing my sanity: 1.1b Validator problems Devin, can you please explain that a little further? The problem that Andrew describes sounds familiar to me. I started using struts1.1b with validator and everything worked fine, just using a DynaValidatorForm. But then when I introduced Tiles to my application the validation didn't take place. Although the ValidatorPlugIn was loaded and there was no Exception ( looking into the logs). It's just that it don't happen. I don't know what you mean by putting a super.validate() as the first line ... because I just use given validation-rules (required, minlength ...) and some DynaValidatorForms. Any help on that ;-? Ralf - Original Message - From: Richards, Devin N (Devin) [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 3:19 PM Subject: RE: Losing my sanity: 1.1b Validator problems I noticed that when I went to 1.1b2 I had to insert a call to super.validate() as the first line in my validate() code to pick up all of the validations I set in my validation.xml file. -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 20, 2002 8:09 PM To: Struts Users Mailing List Subject: Losing my sanity: 1.1b Validator problems I upgraded to Struts 1.1b last week (and to Tomcat 4.1.9 - which is great great stuff) and everything seemed to go fine
RE: Losing my sanity: 1.1b Validator problems
You have all of your validations in the XML? Have you tried adding the html:javascript formName=yourForm to the JSP page to see if the validation is working correctly? Once you have this you can view source and see the validation code it generated. This will show you if the validator plug-in is setup correctly and that your XML is correct. BTW: we are most likely going to production on 1.1-b2 Good luck. -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 12:13 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Losing my sanity: 1.1b Validator problems Devin, thanks for further the further explanation. I replied to your previous email earlier this morning, but it seems to have been lost in the ether. Anyway, I also tried including super.validate() in my form bean, which confirmed that Validation is in fact being done. The mystery is why validation is being performed but control is never returned to the JSP. It simply dies. No error. Nothing. I didn't change anything in the code when moving to 1.1b, so am beginning to wonder if this is a bug of some sort. I've spent way too many hours trying to track down the problem and may have to just go back to 1.1a if I can't find a solution today. Thanks again for the help. Andrew On Wednesday, August 21, 2002, at 10:16 AM, Richards, Devin N (Devin) wrote: I had some validation that was done in the validation.xml (required/minlenght etc) and then I wanted to do some business rule validation that I could not do in the XML. When I put the code into my form bean's validate() method, I got all of the business validations, but none of my basic required/minlenght validations that were done in the XML. Once I added a call to super.validate() it picked them up. Here is part of the struts-config.xml: action path=/rmaFormSubmit name=rmaForm type=com.lucent.portal.rma.RmaFormAction input=rmaFormDef scope=request parameter=submit validate=true forward name=continue path=rmaAckDef / /action plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml, /WEB-INF/classes/com/lucent/portal/rma/RmaValidation.xml / /plug-in The rmaAckDef as well as rmaFormDef are Tiles definations. Here is part of RmaValidation.xml: formset form name=rmaForm field property=companyName depends=required arg0 key=label.companyName / /field field property=firstName depends=required arg0 key=label.firstName / /field /formset For these validations I use the html:javascript tag in the form JSP to catch all normal validations before submit. Here is part of the RmaForm.java (extends ValidatorForm): public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { // // Do validations from XML ActionErrors errors = super.validate(mapping, request); // // Extended validation checking if(this.isDoa()) if(!checkDosOrderNumber()) errors.add(dosOrderNumber, new ActionError(rma.errors.form.dosOrderNumber)); return errors; } In order to get the validatios from RmaValidation.xml I had to put the call to super.validate(). HTH -Devin -Original Message- From: Ralf Lorenz [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 10:21 AM To: Struts Users Mailing List Subject: Re: Losing my sanity: 1.1b Validator problems Devin, can you please explain that a little further? The problem that Andrew describes sounds familiar to me. I started using struts1.1b with validator and everything worked fine, just using a DynaValidatorForm. But then when I introduced Tiles to my application the validation didn't take place. Although the ValidatorPlugIn was loaded and there was no Exception ( looking into the logs). It's just that it don't happen. I don't know what you mean by putting a super.validate() as the first line ... because I just use given validation-rules (required, minlength ...) and some DynaValidatorForms. Any help on that ;-? Ralf - Original Message - From: Richards, Devin N (Devin) [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 3:19 PM Subject
Re: Losing my sanity: 1.1b Validator problems (more info)
Yes. I've checked repeatedly and all the validations are there. Again, the validations *are* being performed. In fact, if I print the number of errors, the plugin seems to be catching the errors properly. Even stranger, if I post the form w/o any errors (the form has been filled out correctly) validation passes and control is *successfully* forwarded to the confirmation page!! Still though, when there are errors, they're caught, but control never makes it back to the JSP. The process just dies. White. This leads me to the conclusion that there is either something wrong with the way I've configured the action, or this is a bug. Here's the action mapping again: actionpath=/registration/save type=com.myapp.action.RegistrationAction name=registrationForm validate=true parameter=save scope=request input=/registration.jsp forward name=failure path=/registration.jsp/ forward name=success path=/do/registration/confirm/ /action On a side note, I am using, and have configured in my xml file, custom validators to do two field comparisons, and to validate that a check box is checked. Again though, validation seems to be working so I don't think this is the problem. Here are the configurations anyway: global validator name=twofields classname=com.myapp.util.Validation method=validateTwoFields methodParams=java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionErrors, javax.servlet.http.HttpServletRequest msg=errors.twofields javascript![CDATA[ ]] /javascript /validator validator name=checked classname=com.myapp.util.Validation method=validateChecked methodParams=java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionErrors, javax.servlet.http.HttpServletRequest msg=errors.checked javascript![CDATA[ ]] /javascript /validator /global Does anyone know what else changed from 1.1a to 1.1b that could be creating this problem?? Thanks for all the suggestions, Andrew On Wednesday, August 21, 2002, at 11:17 AM, Richards, Devin N (Devin) wrote: You have all of your validations in the XML? Have you tried adding the html:javascript formName=yourForm to the JSP page to see if the validation is working correctly? Once you have this you can view source and see the validation code it generated. This will show you if the validator plug-in is setup correctly and that your XML is correct. BTW: we are most likely going to production on 1.1-b2 Good luck. -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 12:13 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Losing my sanity: 1.1b Validator problems Devin, thanks for further the further explanation. I replied to your previous email earlier this morning, but it seems to have been lost in the ether. Anyway, I also tried including super.validate() in my form bean, which confirmed that Validation is in fact being done. The mystery is why validation is being performed but control is never returned to the JSP. It simply dies. No error. Nothing. I didn't change anything in the code when moving to 1.1b, so am beginning to wonder if this is a bug of some sort. I've spent way too many hours trying to track down the problem and may have to just go back to 1.1a if I can't find a solution today. Thanks again for the help. Andrew On Wednesday, August 21, 2002, at 10:16 AM, Richards, Devin N (Devin) wrote: I had some validation that was done in the validation.xml (required/minlenght etc) and then I wanted to do some business rule validation that I could not do in the XML. When I put the code into my form bean's validate() method, I got all of the business validations, but none of my basic required/minlenght validations that were done in the XML. Once I added a call to super.validate() it picked them up. Here is part of the struts-config.xml: action path=/rmaFormSubmit name=rmaForm type=com.lucent.portal.rma.RmaFormAction input=rmaFormDef scope=request parameter=submit validate=true
SOLVED: Losing my sanity: 1.1b Validator problems
I think it's time for a beer. I changed my action mapping definition from: actionpath=/registration/save type=com.myapp.action.RegistrationAction name=registrationForm validate=true parameter=save scope=request input=/registration.jsp forward name=failure path=/registration.jsp/ forward name=success path=/do/registration/confirm/ /action to: actionpath=/registration/save name=registrationForm type=com.myapp.action.RegistrationAction input=/registration.jsp scope=request parameter=save validate=true forward name=failure path=/registration.jsp/ forward name=success path=/do/registration/confirm/ /action and it worked. Andrew On Wednesday, August 21, 2002, at 11:17 AM, Richards, Devin N (Devin) wrote: You have all of your validations in the XML? Have you tried adding the html:javascript formName=yourForm to the JSP page to see if the validation is working correctly? Once you have this you can view source and see the validation code it generated. This will show you if the validator plug-in is setup correctly and that your XML is correct. BTW: we are most likely going to production on 1.1-b2 Good luck. -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 12:13 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Losing my sanity: 1.1b Validator problems Devin, thanks for further the further explanation. I replied to your previous email earlier this morning, but it seems to have been lost in the ether. Anyway, I also tried including super.validate() in my form bean, which confirmed that Validation is in fact being done. The mystery is why validation is being performed but control is never returned to the JSP. It simply dies. No error. Nothing. I didn't change anything in the code when moving to 1.1b, so am beginning to wonder if this is a bug of some sort. I've spent way too many hours trying to track down the problem and may have to just go back to 1.1a if I can't find a solution today. Thanks again for the help. Andrew On Wednesday, August 21, 2002, at 10:16 AM, Richards, Devin N (Devin) wrote: I had some validation that was done in the validation.xml (required/minlenght etc) and then I wanted to do some business rule validation that I could not do in the XML. When I put the code into my form bean's validate() method, I got all of the business validations, but none of my basic required/minlenght validations that were done in the XML. Once I added a call to super.validate() it picked them up. Here is part of the struts-config.xml: action path=/rmaFormSubmit name=rmaForm type=com.lucent.portal.rma.RmaFormAction input=rmaFormDef scope=request parameter=submit validate=true forward name=continue path=rmaAckDef / /action plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml, /WEB-INF/classes/com/lucent/portal/rma/RmaValidation.xml / /plug-in The rmaAckDef as well as rmaFormDef are Tiles definations. Here is part of RmaValidation.xml: formset form name=rmaForm field property=companyName depends=required arg0 key=label.companyName / /field field property=firstName depends=required arg0 key=label.firstName / /field /formset For these validations I use the html:javascript tag in the form JSP to catch all normal validations before submit. Here is part of the RmaForm.java (extends ValidatorForm): public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { // // Do validations from XML ActionErrors errors = super.validate(mapping, request); // // Extended validation checking if(this.isDoa()) if(!checkDosOrderNumber()) errors.add(dosOrderNumber, new ActionError(rma.errors.form.dosOrderNumber)); return errors; } In order to get the validatios from RmaValidation.xml I had to put the call to super.validate(). HTH -Devin -Original Message- From: Ralf Lorenz [mailto:[EMAIL
RE: SOLVED: Losing my sanity: 1.1b Validator problems
Andrew, It's been my experience that if you don't specify parameters in the order the DTD specifies, you can get some funky results.. Jerry -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 3:46 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: SOLVED: Losing my sanity: 1.1b Validator problems I think it's time for a beer. I changed my action mapping definition from: actionpath=/registration/save type=com.myapp.action.RegistrationAction name=registrationForm validate=true parameter=save scope=request input=/registration.jsp forward name=failure path=/registration.jsp/ forward name=success path=/do/registration/confirm/ /action to: actionpath=/registration/save name=registrationForm type=com.myapp.action.RegistrationAction input=/registration.jsp scope=request parameter=save validate=true forward name=failure path=/registration.jsp/ forward name=success path=/do/registration/confirm/ /action and it worked. Andrew On Wednesday, August 21, 2002, at 11:17 AM, Richards, Devin N (Devin) wrote: You have all of your validations in the XML? Have you tried adding the html:javascript formName=yourForm to the JSP page to see if the validation is working correctly? Once you have this you can view source and see the validation code it generated. This will show you if the validator plug-in is setup correctly and that your XML is correct. BTW: we are most likely going to production on 1.1-b2 Good luck. -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 12:13 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Losing my sanity: 1.1b Validator problems Devin, thanks for further the further explanation. I replied to your previous email earlier this morning, but it seems to have been lost in the ether. Anyway, I also tried including super.validate() in my form bean, which confirmed that Validation is in fact being done. The mystery is why validation is being performed but control is never returned to the JSP. It simply dies. No error. Nothing. I didn't change anything in the code when moving to 1.1b, so am beginning to wonder if this is a bug of some sort. I've spent way too many hours trying to track down the problem and may have to just go back to 1.1a if I can't find a solution today. Thanks again for the help. Andrew On Wednesday, August 21, 2002, at 10:16 AM, Richards, Devin N (Devin) wrote: I had some validation that was done in the validation.xml (required/minlenght etc) and then I wanted to do some business rule validation that I could not do in the XML. When I put the code into my form bean's validate() method, I got all of the business validations, but none of my basic required/minlenght validations that were done in the XML. Once I added a call to super.validate() it picked them up. Here is part of the struts-config.xml: action path=/rmaFormSubmit name=rmaForm type=com.lucent.portal.rma.RmaFormAction input=rmaFormDef scope=request parameter=submit validate=true forward name=continue path=rmaAckDef / /action plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml, /WEB-INF/classes/com/lucent/portal/rma/RmaValidation.xml / /plug-in The rmaAckDef as well as rmaFormDef are Tiles definations. Here is part of RmaValidation.xml: formset form name=rmaForm field property=companyName depends=required arg0 key=label.companyName / /field field property=firstName depends=required arg0 key=label.firstName / /field /formset For these validations I use the html:javascript tag in the form JSP to catch all normal validations before submit. Here is part of the RmaForm.java (extends ValidatorForm): public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { // // Do validations from XML ActionErrors errors = super.validate(mapping, request
Re: SOLVED: Losing my sanity: 1.1b Validator problems
Funky results indeed. However, it's clear the order is not strictly enforced. Struts's own example application and online documentation have example after example of out of order parameters. Actually, I'm pretty sure my mapping was originally copy and pasted from the example application. On Wednesday, August 21, 2002, at 03:38 PM, Jerry Jalenak wrote: Andrew, It's been my experience that if you don't specify parameters in the order the DTD specifies, you can get some funky results.. Jerry -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 3:46 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: SOLVED: Losing my sanity: 1.1b Validator problems I think it's time for a beer. I changed my action mapping definition from: actionpath=/registration/save type=com.myapp.action.RegistrationAction name=registrationForm validate=true parameter=save scope=request input=/registration.jsp forward name=failure path=/registration.jsp/ forward name=success path=/do/registration/confirm/ /action to: actionpath=/registration/save name=registrationForm type=com.myapp.action.RegistrationAction input=/registration.jsp scope=request parameter=save validate=true forward name=failure path=/registration.jsp/ forward name=success path=/do/registration/confirm/ /action and it worked. Andrew On Wednesday, August 21, 2002, at 11:17 AM, Richards, Devin N (Devin) wrote: You have all of your validations in the XML? Have you tried adding the html:javascript formName=yourForm to the JSP page to see if the validation is working correctly? Once you have this you can view source and see the validation code it generated. This will show you if the validator plug-in is setup correctly and that your XML is correct. BTW: we are most likely going to production on 1.1-b2 Good luck. -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 12:13 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Losing my sanity: 1.1b Validator problems Devin, thanks for further the further explanation. I replied to your previous email earlier this morning, but it seems to have been lost in the ether. Anyway, I also tried including super.validate() in my form bean, which confirmed that Validation is in fact being done. The mystery is why validation is being performed but control is never returned to the JSP. It simply dies. No error. Nothing. I didn't change anything in the code when moving to 1.1b, so am beginning to wonder if this is a bug of some sort. I've spent way too many hours trying to track down the problem and may have to just go back to 1.1a if I can't find a solution today. Thanks again for the help. Andrew On Wednesday, August 21, 2002, at 10:16 AM, Richards, Devin N (Devin) wrote: I had some validation that was done in the validation.xml (required/minlenght etc) and then I wanted to do some business rule validation that I could not do in the XML. When I put the code into my form bean's validate() method, I got all of the business validations, but none of my basic required/minlenght validations that were done in the XML. Once I added a call to super.validate() it picked them up. Here is part of the struts-config.xml: action path=/rmaFormSubmit name=rmaForm type=com.lucent.portal.rma.RmaFormAction input=rmaFormDef scope=request parameter=submit validate=true forward name=continue path=rmaAckDef / /action plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml, /WEB-INF/classes/com/lucent/portal/rma/RmaValidation.xml / /plug-in The rmaAckDef as well as rmaFormDef are Tiles definations. Here is part of RmaValidation.xml: formset form name=rmaForm field property=companyName depends=required arg0 key=label.companyName / /field field property=firstName depends=required arg0 key=label.firstName / /field /formset For these validations I use the html:javascript tag in the form JSP to catch all normal validations before submit. Here is part of the RmaForm.java (extends ValidatorForm): public ActionErrors
RE: SOLVED: Losing my sanity: 1.1b Validator problems
What about using *.do not path mapping with /do/*, I know that 1.1 likes the *.do better. web.xml: !-- Standard Action Servlet Mapping -- servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 4:46 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: SOLVED: Losing my sanity: 1.1b Validator problems I think it's time for a beer. I changed my action mapping definition from: actionpath=/registration/save type=com.myapp.action.RegistrationAction name=registrationForm validate=true parameter=save scope=request input=/registration.jsp forward name=failure path=/registration.jsp/ forward name=success path=/do/registration/confirm/ /action to: actionpath=/registration/save name=registrationForm type=com.myapp.action.RegistrationAction input=/registration.jsp scope=request parameter=save validate=true forward name=failure path=/registration.jsp/ forward name=success path=/do/registration/confirm/ /action and it worked. Andrew On Wednesday, August 21, 2002, at 11:17 AM, Richards, Devin N (Devin) wrote: You have all of your validations in the XML? Have you tried adding the html:javascript formName=yourForm to the JSP page to see if the validation is working correctly? Once you have this you can view source and see the validation code it generated. This will show you if the validator plug-in is setup correctly and that your XML is correct. BTW: we are most likely going to production on 1.1-b2 Good luck. -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 12:13 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Losing my sanity: 1.1b Validator problems Devin, thanks for further the further explanation. I replied to your previous email earlier this morning, but it seems to have been lost in the ether. Anyway, I also tried including super.validate() in my form bean, which confirmed that Validation is in fact being done. The mystery is why validation is being performed but control is never returned to the JSP. It simply dies. No error. Nothing. I didn't change anything in the code when moving to 1.1b, so am beginning to wonder if this is a bug of some sort. I've spent way too many hours trying to track down the problem and may have to just go back to 1.1a if I can't find a solution today. Thanks again for the help. Andrew On Wednesday, August 21, 2002, at 10:16 AM, Richards, Devin N (Devin) wrote: I had some validation that was done in the validation.xml (required/minlenght etc) and then I wanted to do some business rule validation that I could not do in the XML. When I put the code into my form bean's validate() method, I got all of the business validations, but none of my basic required/minlenght validations that were done in the XML. Once I added a call to super.validate() it picked them up. Here is part of the struts-config.xml: action path=/rmaFormSubmit name=rmaForm type=com.lucent.portal.rma.RmaFormAction input=rmaFormDef scope=request parameter=submit validate=true forward name=continue path=rmaAckDef / /action plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml, /WEB-INF/classes/com/lucent/portal/rma/RmaValidation.xml / /plug-in The rmaAckDef as well as rmaFormDef are Tiles definations. Here is part of RmaValidation.xml: formset form name=rmaForm field property=companyName depends=required arg0 key=label.companyName / /field field property=firstName depends=required arg0 key=label.firstName / /field /formset For these validations I use the html:javascript tag in the form JSP to catch all normal validations before submit. Here is part of the RmaForm.java (extends ValidatorForm): public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { // // Do validations from XML ActionErrors errors = super.validate(mapping, request
Re: SOLVED: Losing my sanity: 1.1b Validator problems
Not sure what you mean here. My understanding was that .do was only necessary for sub-applications. On Wednesday, August 21, 2002, at 04:17 PM, Richards, Devin N (Devin) wrote: What about using *.do not path mapping with /do/*, I know that 1.1 likes the *.do better. web.xml: !-- Standard Action Servlet Mapping -- servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 4:46 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: SOLVED: Losing my sanity: 1.1b Validator problems I think it's time for a beer. I changed my action mapping definition from: actionpath=/registration/save type=com.myapp.action.RegistrationAction name=registrationForm validate=true parameter=save scope=request input=/registration.jsp forward name=failure path=/registration.jsp/ forward name=success path=/do/registration/confirm/ /action to: actionpath=/registration/save name=registrationForm type=com.myapp.action.RegistrationAction input=/registration.jsp scope=request parameter=save validate=true forward name=failure path=/registration.jsp/ forward name=success path=/do/registration/confirm/ /action and it worked. Andrew On Wednesday, August 21, 2002, at 11:17 AM, Richards, Devin N (Devin) wrote: You have all of your validations in the XML? Have you tried adding the html:javascript formName=yourForm to the JSP page to see if the validation is working correctly? Once you have this you can view source and see the validation code it generated. This will show you if the validator plug-in is setup correctly and that your XML is correct. BTW: we are most likely going to production on 1.1-b2 Good luck. -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 12:13 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Losing my sanity: 1.1b Validator problems Devin, thanks for further the further explanation. I replied to your previous email earlier this morning, but it seems to have been lost in the ether. Anyway, I also tried including super.validate() in my form bean, which confirmed that Validation is in fact being done. The mystery is why validation is being performed but control is never returned to the JSP. It simply dies. No error. Nothing. I didn't change anything in the code when moving to 1.1b, so am beginning to wonder if this is a bug of some sort. I've spent way too many hours trying to track down the problem and may have to just go back to 1.1a if I can't find a solution today. Thanks again for the help. Andrew On Wednesday, August 21, 2002, at 10:16 AM, Richards, Devin N (Devin) wrote: I had some validation that was done in the validation.xml (required/minlenght etc) and then I wanted to do some business rule validation that I could not do in the XML. When I put the code into my form bean's validate() method, I got all of the business validations, but none of my basic required/minlenght validations that were done in the XML. Once I added a call to super.validate() it picked them up. Here is part of the struts-config.xml: action path=/rmaFormSubmit name=rmaForm type=com.lucent.portal.rma.RmaFormAction input=rmaFormDef scope=request parameter=submit validate=true forward name=continue path=rmaAckDef / /action plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml, /WEB-INF/classes/com/lucent/portal/rma/RmaValidation.xml / /plug-in The rmaAckDef as well as rmaFormDef are Tiles definations. Here is part of RmaValidation.xml: formset form name=rmaForm field property=companyName depends=required arg0 key=label.companyName / /field field property=firstName depends=required arg0 key=label.firstName / /field /formset For these validations I use the html:javascript tag in the form JSP to catch all normal validations before submit. Here is part of the RmaForm.java (extends ValidatorForm): public ActionErrors validate(ActionMapping
RE: SOLVED: Losing my sanity: 1.1b Validator problems
Here! Here! -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 4:46 PM I think it's time for a beer. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: SOLVED: Losing my sanity: 1.1b Validator problems
On Wed, 21 Aug 2002, Jerry Jalenak wrote: Date: Wed, 21 Aug 2002 15:38:14 -0500 From: Jerry Jalenak [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: SOLVED: Losing my sanity: 1.1b Validator problems Andrew, It's been my experience that if you don't specify parameters in the order the DTD specifies, you can get some funky results.. If you're talking about the order of attributes in a single element, then only broken XML parsers would be affected. Parsing should not be affected by the order of attributes. Jerry Craig -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 3:46 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: SOLVED: Losing my sanity: 1.1b Validator problems I think it's time for a beer. I changed my action mapping definition from: actionpath=/registration/save type=com.myapp.action.RegistrationAction name=registrationForm validate=true parameter=save scope=request input=/registration.jsp forward name=failure path=/registration.jsp/ forward name=success path=/do/registration/confirm/ /action to: actionpath=/registration/save name=registrationForm type=com.myapp.action.RegistrationAction input=/registration.jsp scope=request parameter=save validate=true forward name=failure path=/registration.jsp/ forward name=success path=/do/registration/confirm/ /action and it worked. Andrew On Wednesday, August 21, 2002, at 11:17 AM, Richards, Devin N (Devin) wrote: You have all of your validations in the XML? Have you tried adding the html:javascript formName=yourForm to the JSP page to see if the validation is working correctly? Once you have this you can view source and see the validation code it generated. This will show you if the validator plug-in is setup correctly and that your XML is correct. BTW: we are most likely going to production on 1.1-b2 Good luck. -Devin -Original Message- From: Andrew Shirk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 12:13 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Losing my sanity: 1.1b Validator problems Devin, thanks for further the further explanation. I replied to your previous email earlier this morning, but it seems to have been lost in the ether. Anyway, I also tried including super.validate() in my form bean, which confirmed that Validation is in fact being done. The mystery is why validation is being performed but control is never returned to the JSP. It simply dies. No error. Nothing. I didn't change anything in the code when moving to 1.1b, so am beginning to wonder if this is a bug of some sort. I've spent way too many hours trying to track down the problem and may have to just go back to 1.1a if I can't find a solution today. Thanks again for the help. Andrew On Wednesday, August 21, 2002, at 10:16 AM, Richards, Devin N (Devin) wrote: I had some validation that was done in the validation.xml (required/minlenght etc) and then I wanted to do some business rule validation that I could not do in the XML. When I put the code into my form bean's validate() method, I got all of the business validations, but none of my basic required/minlenght validations that were done in the XML. Once I added a call to super.validate() it picked them up. Here is part of the struts-config.xml: action path=/rmaFormSubmit name=rmaForm type=com.lucent.portal.rma.RmaFormAction input=rmaFormDef scope=request parameter=submit validate=true forward name=continue path=rmaAckDef / /action plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml, /WEB-INF/classes/com/lucent/portal/rma/RmaValidation.xml / /plug-in The rmaAckDef as well as rmaFormDef are Tiles definations. Here is part of RmaValidation.xml: formset form name=rmaForm field property=companyName depends=required arg0 key=label.companyName / /field field property=firstName depends=required arg0 key
Losing my sanity: 1.1b Validator problems
I upgraded to Struts 1.1b last week (and to Tomcat 4.1.9 - which is great great stuff) and everything seemed to go fine. However, today, I was demonstrating my app to a friend when I noticed Validator validations were not being performed. I checked the logs and the validation configuration files are being loaded just fine, but still no validation errors were being caught. I also noticed in the archives mention of a change in the way the plugin is configured in struts- config.xml. I made the change in my struts-config.xml thinking that must have been the problem, but alas, things got worse! Now, when the ValidatorForm is posted to the server, nothing happens at all! After about 10 seconds of processing, the browser seems to receive an empty response. A blank document is all that's received. I checked the logs, and no exceptions are being thrown. I have checked everything I can think of 4 or 5 times, and don't know what else to do. This worked perfectly in 1.1a. Please help if you have any ideas. Thanks very much, Andrew registrationForm extends ValidatorForm actionpath=/registration/save type=com.myapp.action.RegistrationAction name=registrationForm validate=true parameter=save scope=request input=/registration.jsp forward name=failure path=/registration.jsp/ forward name=success path=/do/registration/confirm/ /action -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Still having weird dynamic validator problems
I posted this problem previously, but got no response... I am hoping someone may notice it this time and help me!! The problem is that the dynamic validator works, finds the problems, sets an error, but then when it goes back to the page that submitted it, I cannot get any errors to display (Although if I check with the messages present it says there are... Any Idea's? http://www.e-bind.com/plantsec.zip (2.5 mb) I run everything here on Tomcat403. There is a datasource defined in the struts-config, but you probably wont need to get that far to see what the problem is... You should be able to drop this into your web-apps directory The issue is not being able to get the error messages back from DynaFormValidator... (Although something is in there) You have my gratitude -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Still having weird dynamic validator problems
hi Baybe a dumb question but are you using the custom tag to display the errors.. I think they are html:errors/ -and- html:messages id=error libean:write name=error//li /html:messages hope this helps anand -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 25, 2002 6:53 PM To: [EMAIL PROTECTED] Subject: Still having weird dynamic validator problems I posted this problem previously, but got no response... I am hoping someone may notice it this time and help me!! The problem is that the dynamic validator works, finds the problems, sets an error, but then when it goes back to the page that submitted it, I cannot get any errors to display (Although if I check with the messages present it says there are... Any Idea's? http://www.e-bind.com/plantsec.zip (2.5 mb) I run everything here on Tomcat403. There is a datasource defined in the struts-config, but you probably wont need to get that far to see what the problem is... You should be able to drop this into your web-apps directory The issue is not being able to get the error messages back from DynaFormValidator... (Although something is in there) You have my gratitude -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]