In my validator.xml file it uses the path of the action - see original post.
I have tried the validator with the DynaValidatorForm and validator.xml referencing the name of the form not the action path - alas this didn't work. Thanks Chris Stav. On Sat, 21 Aug 2004 14:14:03 +0200, Matthias Wessendorf <[EMAIL PROTECTED]> wrote: > DynaValidatorActionForm > is for forms, that contain more than *one* page > (like a wizzard or a poll) > > in validation.xml you must enter on > name attribute the PATH of the action -> > > name="/submit1"... > > but I guess you want a Validator for a single page > > so use DynaValidatorForm > now in vali.xml you must edit something like this: > name="nameOfTheBeanInMyStrutsConfigFile"... > > hope it helps, > > Regards, > Matthias > > > > -----Original Message----- > > From: Chris Stavrianou [mailto:[EMAIL PROTECTED] > > Sent: Saturday, August 21, 2004 1:00 PM > > To: [EMAIL PROTECTED] > > Subject: Newbie Validator Basic Configuration > > > > > > Hi, > > > > I am attempting to use Validator with > > DynaValidatorActionForms - but can't get the Validator Plugin to work. > > > > Even the most basic form refuses to validate - please help. > > > > I have followed all FAQ - Mailing lists and books that I can find. > > > > Please find following relevant sections from Login.jsp, > > Struts-Config.xml, and Validation.xml > > > > > > Thanks > > > > Chris Stav > > > > ----------------- > > //Struts-Config.xml > > > > <form-beans> > > > > <form-bean name="loginForm" > > type="org.apache.struts.validator.DynaValidatorActionForm"> > > <form-property name="username" type="java.lang.String"/> > > <form-property name="password" type="java.lang.String"/> > > </form-bean> > > </form-beans> > > > > .... > > > > <action path="/loginpage" > > type="org.apache.struts.actions.ForwardAction" > > parameter="login.main"/> > > > > <action path="/login" type="com.FooBar.LoginAction" > > name="loginForm" scope="request" validate="true" > > input="/loginpage.do"> > > <forward name="admin" path="/admin/mainmenu.do" > > redirect="true"/> > > <forward name="super" path="/super/mainmenu.do" > > redirect="true"/> > > <forward name="user" path="/user/mainmenu.do" > > redirect="true"/> > > <forward name="failure" path="/loginerror.do" > > redirect="true"/> > > </action> > > .... > > > > <!-- ========== Validation plugin =================== --> > > > > <plug-in > > className="org.apache.struts.validator.ValidatorPlugIn"> > > <set-property > > property="pathnames" > > value="/WEB-INF/validator-rules.xml, > > /WEB-INF/validation.xml"/> > > </plug-in> > > > > ------------------------- > > //Validation.xml > > > > <?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> > > </global> > > > > <formset> > > > > <form name="/login"> > > <field propery="username" > > depends="required"> > > <arg0 key="Username" resource="false"/> > > </field> > > <field propery="password" > > depends="required"> > > <arg0 key="Password" resource="false"/> > > </field> > > </form> > > > > </formset> > > > > </form-validation> > > > > ------------------------ > > //Login.jsp > > > > <logic:notPresent name="<%= ValidatorPlugIn.VALIDATOR_KEY %>" > > scope="application"> > > <font color="red"> > > ERROR: Validator resources not loaded -- check Commons Logging > > logs for error messages. > > </font> > > </logic:notPresent> > > <html:errors/> > > > > <html:form action="/login"> > > <DIV ALIGN="CENTER"> > > <table> > > <tr><td class="loginborder"> > > > > <table> > > <tr><td> > > <TABLE> > > <tr><td class="logincell">User Name:</TD> > > <TD class="logincell"><html:text > > property="username"/></TD></TR> <tr><td > > class="logincell">Password:</TD> <TD > > class="logincell"><html:password property="password"/> > > </td></tr> </table> </td></tr> > > > > <tr><td> > > <html:submit/> > > </td></tr> > > </table> > > > > </td> > > </tr> > > </table> > > </DIV> > > > > </html:form> > > > > --------------------------------------------------------------------- > > 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]