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]



Reply via email to