Looking at the original post, where you showed your struts-config.xml and
validation.xml - you're using the wrong flavour of Dyna form...

1) DynaValidatorActionForm validates according to the Action Mapping's path

So in your validation.xml you would have three forms as follows...

<form-validation>
     <formset>
         <form name="/reg/step1">
             ....
         </form>
         <form name="/reg/step2">
         </form>
         <form name="/reg/step3">
         </form>

2) DynaValidatorForm validates according to the Action Mapping's form name.

So in your validation.xml you would have one form (as you do)....
<form-validation>
     <formset>
         <form name="registrationForm">
             ....
         </form>

Niall


----- Original Message ----- 
From: "David G. Friedman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, November 23, 2004 4:55 AM
Subject: RE: Multi-Page Wizard Validation Problem


> Jeff,
>
> This is my final set of questions (I'm out of questions and will concede
> being useless if this question fails).
>
> I noticed your reg actions are all of class
> "com.rochets.application.action.RegistrationAction".  Do you have your own
> validate method in those actions or are you leaving it to the default
> provided by whatever class you subclass?  Are they simply
> org.apache.struts.action.Action(?) subclasses with no overridden(?)
> validate() method?  If defined your own validate() method and are not
> calling super.validate or invoking the form's validate() method
> appropriately, perhaps no ActionMessages/ActionErrors are being returned
so
> it looks like the validation is clear when it should be failing.
>
> Regards,
> David
>
> -----Original Message-----
> From: Jeff Smith [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 22, 2004 11:43 PM
> To: Struts Users Mailing List
> Subject: Re: Multi-Page Wizard Validation Problem
>
>
> I tried setting the page number in the first page to 5. When I hit next
> it gets correctly incremented to 6 but no validation.
>
> If I put stuff back to normal but add some output to the page of the
> page number I get
> 1 when I start, 2 after submitting step 1, 3 after submitting step 2.
> Seems to be correct.
>
> -jeff
>
>
> On Nov 22, 2004, at 9:33 PM, David G. Friedman wrote:
>
> > Jeff,
> >
> > Have you tried going to the first step and hard-coding the hidden
> > variable
> > "page" to be something high like "5". That would force it to try all
> > validations.
> >
> > Can you print out the value of the "page" form field in each JSP?  I'd
> > like
> > to know when you submit your various forms to /reg/step1.do,
> > /reg/step2.do,
> > /reg/step3.do, what is the value of the "page" attribute submitted.
> >
> > Regards,
> > David (he who must be missing something from all of the details you
> > provided! LOL)
> >
> > -----Original Message-----
> > From: Jeff Smith [mailto:[EMAIL PROTECTED]
> > Sent: Monday, November 22, 2004 11:26 PM
> > To: Struts Users Mailing List
> > Subject: Re: Multi-Page Wizard Validation Problem
> >
> >
> > David,
> >
> > Thanks for all your help with this.
> >
> > I tried setting the input attribute to a dummy jsp page and it never
> > gets there either. I also confirmed that I had the appropriate messages
> > in my resource bundle, although I don't know why that would make a
> > difference. At this point I'll try anything.
> >
> > When the app deploys I see the following:
> >       [java] 21:19:27,059 INFO  [ValidatorPlugIn] Loading validation
> > rules file from '/WEB-INF/validator-rules.xml'
> >       [java] 21:19:27,063 INFO  [ValidatorPlugIn] Loading validation
> > rules file from '/WEB-INF/validation.xml'
> >       [java] 21:19:27,379 INFO  [ValidatorPlugIn] Loading validation
> > rules file from '/WEB-INF/struts/reg/validation.xml'
> >
> > The third one is the one in question. So it appears the validator is
> > loading my file correctly.
> >
> >
> >
> > On Nov 22, 2004, at 9:14 PM, David G. Friedman wrote:
> >
> >> Jeff,
> >>
> >> Have you tried setting the input="" attribute to a completely
> >> different page
> >> to make sure validation IS failing and that you're just not properly
> >> showing
> >> error messages?
> >>
> >> Do your logs show the Validation plugIn being configured upon
> >> web-application startup?
> >>
> >> Regards,
> >> David
> >>
> >> -----Original Message-----
> >> From: Jeff Smith [mailto:[EMAIL PROTECTED]
> >> Sent: Monday, November 22, 2004 9:37 AM
> >> To: Struts Users Mailing List
> >> Subject: Re: Multi-Page Wizard Validation Problem
> >>
> >>
> >> I added that, it fixes the page always resetting problem, but still no
> >> validation between page changes.
> >>
> >> On Nov 22, 2004, at 7:26 AM, Bill Siggelkow wrote:
> >>
> >>> I believe you need a form-property named 'page' with a type of
> >>> 'java.lang.Integer'.
> >>>
> >>> -Bill Siggelkow
> >>>
> >>>
> >>>
> >>> Jeff Smith wrote:
> >>>> Let me paste the files in instead
> >>>> -- struts config starts here --
> >>>> <?xml version="1.0" encoding="iso-8859-1"?>
> >>>> <!DOCTYPE struts-config PUBLIC
> >>>>           "-//Apache Software Foundation//DTD Struts Configuration
> >>>> 1.2//EN"
> >>>>           "http://struts.apache.org/dtds/struts-config_1_2.dtd";>
> >>>> <struts-config>
> >>>>     <!--
> >>>>     Form Bean Definitions
> >>>>     -->
> >>>>     <form-beans>
> >>>>         <form-bean name="registrationForm"
> >>>> type="org.apache.struts.validator.DynaValidatorActionForm">
> >>>>             <!-- Page One -->
> >>>>             <form-property name="firstName"
> >>>> type="java.lang.String"/>
> >>>>             <form-property name="middleName"
> >>>> type="java.lang.String"/>
> >>>>             <form-property name="lastName" type="java.lang.String"/>
> >>>>             <form-property name="username" type="java.lang.String"/>
> >>>>             <form-property name="password" type="java.lang.String"/>
> >>>>             <form-property name="password2"
> >>>> type="java.lang.String"/>
> >>>>             <!-- Page Two -->
> >>>>             <form-property name="birthDate"
> >>>> type="java.lang.String"/>
> >>>>             <!-- Page Three -->
> >>>>             <form-property name="street1" type="java.lang.String"/>
> >>>>             <form-property name="street2" type="java.lang.String"/>
> >>>>             <form-property name="city" type="java.lang.String"/>
> >>>>             <form-property name="state" type="java.lang.String"/>
> >>>>             <form-property name="country" type="java.lang.String"/>
> >>>>             <form-property name="postalCode"
> >>>> type="java.lang.String"/>
> >>>>         </form-bean>
> >>>>     </form-beans>
> >>>>     <!--
> >>>>     Action Mappings
> >>>>     -->
> >>>>     <action-mappings>
> >>>>         <action path="/reg/step1"
> >>>>             parameter="command"
> >>>>             type="com.rochets.application.action.RegistrationAction"
> >>>>             name="registrationForm"
> >>>>             scope="session"
> >>>>             validate="true"
> >>>>             input="reg.step1">
> >>>>             <forward name="next" path="reg.step2"/>
> >>>>             <forward name="cancel"
> >>>> path="/WEB-INF/jsp/mywizardcancel.jsp"/>
> >>>>         </action>
> >>>>         <action path="/reg/step2"
> >>>>             parameter="command"
> >>>>             type="com.rochets.application.action.RegistrationAction"
> >>>>             name="registrationForm"
> >>>>             scope="session"
> >>>>             validate="true"
> >>>>             input="reg.step2">
> >>>>             <forward name="previous" path="reg.step1"/>
> >>>>             <forward name="next" path="reg.step3"/>
> >>>>             <forward name="finish"
> >>>> path="/WEB-INF/jsp/mywizarddone.jsp"/>
> >>>>             <forward name="cancel"
> >>>> path="/WEB-INF/jsp/mywizardcancel.jsp"/>
> >>>>         </action>
> >>>>         <action path="/reg/step3"
> >>>>             parameter="command"
> >>>>             type="com.rochets.application.action.RegistrationAction"
> >>>>             name="registrationForm"
> >>>>             scope="session"
> >>>>             validate="true"
> >>>>             input="reg.step3">
> >>>>             <forward name="previous" path="reg.step3"/>
> >>>>             <forward name="finish"
> >>>> path="/WEB-INF/jsp/mywizarddone.jsp"/>
> >>>>             <forward name="cancel"
> >>>> path="/WEB-INF/jsp/mywizardcancel.jsp"/>
> >>>>         </action>
> >>>>         <action path="/reg/registration"
> >>>>             parameter="command"
> >>>>             name="registrationForm"
> >>>>             scope="session"
> >>>>             type="com.rochets.application.action.RegistrationAction"
> >>>>             validate="true"
> >>>>             input="/reg/registration.do">
> >>>>             <forward name="next" path="reg.step1"/>
> >>>>         </action>
> >>>>     </action-mappings>
> >>>>     <message-resources parameter="resources.reg.Registration"
> >>>> null="false"/>
> >>>>     <plug-in
> >>>> className="org.apache.struts.validator.ValidatorPlugIn">
> >>>>         <set-property
> >>>>             property="pathnames"
> >>>>             value="/WEB-INF/struts/reg/validation.xml"/>
> >>>>     </plug-in>
> >>>> </struts-config>
> >>>> -- validation.xml starts here --
> >>>> <?xml version="1.0" encoding="iso-8859-1"?>
> >>>> <!DOCTYPE form-validation PUBLIC
> >>>>           "-//Apache Software Foundation//DTD Commons Validator
> >>>> Rules
> >>>> Configuration 1.1.3//EN"
> >>>>
> >>>> "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd";>
> >>>> <form-validation>
> >>>>     <formset>
> >>>>         <form name="registrationForm">
> >>>>             <!-- Page One -->
> >>>>             <field property="firstName"
> >>>> depends="required,mask,minlength,maxlength" page="1">
> >>>>                 <arg key="firstname" position="0"/>
> >>>>                 <arg name="minlength" key="${var:minlength}"
> >>>> resource="false" position="1"/>
> >>>>                 <var>
> >>>>                   <var-name>mask</var-name>
> >>>>                   <var-value>^\w+$</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                   <var-name>minlength</var-name>
> >>>>                   <var-value>2</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                   <var-name>maxlength</var-name>
> >>>>                   <var-value>255</var-value>
> >>>>                 </var>
> >>>>             </field>
> >>>>             <field property="middleName" depends="mask,maxlength"
> >>>> page="1">
> >>>>                 <arg key="firstname" position="0"/>
> >>>>                 <var>
> >>>>                   <var-name>mask</var-name>
> >>>>                   <var-value>^\w+$</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                   <var-name>maxlength</var-name>
> >>>>                   <var-value>255</var-value>
> >>>>                 </var>
> >>>>             </field>
> >>>>             <field property="lastName"
> >>>> depends="required,mask,minlength,maxlength" page="1">
> >>>>                 <arg key="lastname" position="0"/>
> >>>>                 <arg name="minlength" key="${var:minlength}"
> >>>> resource="false" position="1"/>
> >>>>                 <var>
> >>>>                   <var-name>mask</var-name>
> >>>>                   <var-value>^\w+$</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                   <var-name>minlength</var-name>
> >>>>                   <var-value>2</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                   <var-name>maxlength</var-name>
> >>>>                   <var-value>255</var-value>
> >>>>                 </var>
> >>>>             </field>
> >>>>             <field property="username"
> >>>> depends="required,maxlength,email" page="1">
> >>>>                 <arg key="username" position="0"/>
> >>>>                 <var>
> >>>>                   <var-name>maxlength</var-name>
> >>>>                   <var-value>255</var-value>
> >>>>                 </var>
> >>>>             </field>
> >>>>             <field property="password"
> >>>> depends="required,minlength,maxlength,twofields" page="1">
> >>>>                 <arg key="password" position="0"/>
> >>>>                 <arg name="minlength" key="${var:minlength}"
> >>>> resource="false" position="1"/>
> >>>>                 <var>
> >>>>                   <var-name>minlength</var-name>
> >>>>                   <var-value>6</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                   <var-name>maxlength</var-name>
> >>>>                   <var-value>255</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                     <var-name>secondProperty</var-name>
> >>>>                     <var-value>password2</var-value>
> >>>>                 </var>
> >>>>             </field>
> >>>>             <field property="password2"
> >>>> depends="required,minlength,maxlength" page="1">
> >>>>                 <arg key="password2" position="0"/>
> >>>>                 <arg name="minlength" key="${var:minlength}"
> >>>> resource="false" position="1"/>
> >>>>                 <var>
> >>>>                   <var-name>minlength</var-name>
> >>>>                   <var-value>6</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                   <var-name>maxlength</var-name>
> >>>>                   <var-value>255</var-value>
> >>>>                 </var>
> >>>>             </field>
> >>>>             <!-- Page Two -->
> >>>>             <field property="birthDate" depends="required,date"
> >>>> page="2">
> >>>>                 <arg key="birthdate" position="0"/>
> >>>>                 <var>
> >>>>                     <var-name>datePatternStrict</var-name>
> >>>>                     <var-value>MM/dd/yyyy</var-value>
> >>>>                 </var>
> >>>>             </field>
> >>>>             <field property="weight"
> >>>> depends="required,minlength,maxlength,integer" page="2">
> >>>>                 <arg key="weight" position="0"/>
> >>>>                 <var>
> >>>>                   <var-name>minlength</var-name>
> >>>>                   <var-value>2</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                   <var-name>maxlength</var-name>
> >>>>                   <var-value>3</var-value>
> >>>>                 </var>
> >>>>             </field>
> >>>>             <field property="goalWeight"
> >>>> depends="required,minlength,maxlength,integer" page="2">
> >>>>                 <arg key="goalweight" position="0"/>
> >>>>                 <var>
> >>>>                   <var-name>minlength</var-name>
> >>>>                   <var-value>2</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                   <var-name>maxlength</var-name>
> >>>>                   <var-value>3</var-value>
> >>>>                 </var>
> >>>>             </field>
> >>>>             <field property="currentDaysPerWeek"
> >>>> depends="required,maxlength,integer,intRange" page="2">
> >>>>                 <arg key="currentdaysperweek" position="0"/>
> >>>>                 <var>
> >>>>                     <var-name>min</var-name>
> >>>>                     <var-value>0</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                     <var-name>max</var-name>
> >>>>                     <var-value>7</var-value>
> >>>>                 </var>
> >>>>             </field>
> >>>>             <field property="availableMinutesPerDay"
> >>>> depends="required,maxlength,integer,intRange" page="2">
> >>>>                 <arg key="availableminutesperday" position="0"/>
> >>>>                 <var>
> >>>>                   <var-name>maxlength</var-name>
> >>>>                   <var-value>3</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                     <var-name>min</var-name>
> >>>>                     <var-value>30</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                     <var-name>max</var-name>
> >>>>                     <var-value>60</var-value>
> >>>>                 </var>
> >>>>             </field>
> >>>>             <field property="availableDays" depends="required"
> >>>> page="2">
> >>>>                 <arg key="availabledays" position="0"/>
> >>>>             </field>
> >>>>             <!-- Page Three -->
> >>>>             <field property="street1"
> >>>> depends="required,minlength,maxlength" page="3">
> >>>>                 <arg key="street1" position="0"/>
> >>>>                 <arg name="minlength" key="${var:minlength}"
> >>>> resource="false" position="1"/>
> >>>>                 <var>
> >>>>                   <var-name>minlength</var-name>
> >>>>                   <var-value>6</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                   <var-name>maxlength</var-name>
> >>>>                   <var-value>255</var-value>
> >>>>                 </var>
> >>>>             </field>
> >>>>             <field property="street1" depends="minlength,maxlength"
> >>>> page="3">
> >>>>                 <arg key="street1" position="0"/>
> >>>>                 <arg name="minlength" key="${var:minlength}"
> >>>> resource="false" position="1"/>
> >>>>                 <var>
> >>>>                   <var-name>minlength</var-name>
> >>>>                   <var-value>6</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                   <var-name>maxlength</var-name>
> >>>>                   <var-value>255</var-value>
> >>>>                 </var>
> >>>>             </field>
> >>>>             <field property="city"
> >>>> depends="required,minlength,maxlength" page="3">
> >>>>                 <arg key="street1" position="0"/>
> >>>>                 <arg name="minlength" key="${var:minlength}"
> >>>> resource="false" position="1"/>
> >>>>                 <var>
> >>>>                   <var-name>minlength</var-name>
> >>>>                   <var-value>2</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                   <var-name>maxlength</var-name>
> >>>>                   <var-value>255</var-value>
> >>>>                 </var>
> >>>>             </field>
> >>>>             <field property="state"
> >>>> depends="required,minlength,maxlength" page="3">
> >>>>                 <arg key="state" position="0"/>
> >>>>                 <arg name="minlength" key="${var:minlength}"
> >>>> resource="false" position="1"/>
> >>>>                 <var>
> >>>>                   <var-name>minlength</var-name>
> >>>>                   <var-value>2</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                   <var-name>maxlength</var-name>
> >>>>                   <var-value>255</var-value>
> >>>>                 </var>
> >>>>             </field>
> >>>>             <field property="country"
> >>>> depends="required,minlength,maxlength" page="3">
> >>>>                 <arg key="country" position="0"/>
> >>>>                 <arg name="minlength" key="${var:minlength}"
> >>>> resource="false" position="1"/>
> >>>>                 <var>
> >>>>                   <var-name>minlength</var-name>
> >>>>                   <var-value>6</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                   <var-name>maxlength</var-name>
> >>>>                   <var-value>255</var-value>
> >>>>                 </var>
> >>>>             </field>
> >>>>             <field property="postalCode"
> >>>> depends="required,minlength,maxlength" page="3">
> >>>>                 <arg key="postalcode" position="0"/>
> >>>>                 <arg name="minlength" key="${var:minlength}"
> >>>> resource="false" position="1"/>
> >>>>                 <var>
> >>>>                   <var-name>minlength</var-name>
> >>>>                   <var-value>5</var-value>
> >>>>                 </var>
> >>>>                 <var>
> >>>>                   <var-name>maxlength</var-name>
> >>>>                   <var-value>255</var-value>
> >>>>                 </var>
> >>>>             </field>
> >>>>         </form>
> >>>>     </formset>
> >>>> </form-validation>
> >>>> On Nov 21, 2004, at 12:07 PM, Jeff Smith wrote:
> >>>>> All,
> >>>>>
> >>>>> Sorry if this has been discussed, I've been digging around on the
> >>>>> web and can't seem to find a solution to my problem. I have a 3
> >>>>> step
> >>>>> registration process that works like a "wizard". I defined a
> >>>>> LookupDispatchAction subclass to handle things like the next and
> >>>>> previous button. Everything works great except validation never
> >>>>> gets
> >>>>> triggered and the page variable on the form bean is always reset to
> >>>>> zero. I have confirmed with the debugger that it is the same
> >>>>> instance of the form bean throughout the steps. I assume the two
> >>>>> problems are related because my validation.xml specifies page
> >>>>> numbers greater than zero. I've attached the struts-config.xml and
> >>>>> the validation.xml.
> >>>>>
> >>>>> Any help is appreciated.
> >>>>>
> >>>>> -jeff
> >>>>>
> >>>>>
> >>>>>
> >>>>> -------------------------------------------------------------------
> >>>>> -
> >>>>> -
> >>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>>>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to