ValidatorActionForm uses the path to find the corresponding validation form rules. So for your "/security/login" action you need to name the form in validation.xml to "security/login" instead of "login".
If you use ValidatorForm instead it uses the form name to find the corresponding validation form rules. So for your "/security/login" action you need to name the form in validation.xml to "security.login" instead of "login". Both ValidatorForm and ValidatorActionForm have validate() method which invokes the Validator framework. If you override these methods, then it won't do any server side validation, unless you call super.validate(). Niall ----- Original Message ----- From: "Mark Mandel" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 29, 2004 8:02 AM Subject: Validator doesn't pick up any errors? > Hey all, > > First time posting to the list. > > Been slowly learning Struts 1.1 over the past few weeks. > > Trying to get the Validator working, to absolutely no avail. I don't get > any Java Errors, and neither do I get any Validator errors. > > I have <html:errors/> In my jsp page. > > I am using an ActionForm that extends ValidatorActionForm. I have tried > this class both without a validate(...) method, and with a validate(..) > method that called a super.validate. > > I have debugged it out, and the validate(..) method on the > ValidatorActionForm returns null. However, I have set both fields to be > required. > > I'm totally stumped. > > I'm hoping someone can see where I am going wrong. > > (I've strippe out the XML and DTD declarations for the sake of brevity) > > struts-config.xml > -- > <struts-config> > <form-beans> > <form-bean name="security.login" > type="com.GSA.ActionForm.Security.Login" /> > </form-beans> > <action-mappings> > <action forward="tiles.page.login" path="/" /> > <action input="tiles.page.login" name="security.login" > path="/security/login" scope="request" type="com.GSA.Action.Security.Login"> > <forward name="Failure" path="tiles.page.login" /> > </action> > </action-mappings> > <plug-in className="org.apache.struts.validator.ValidatorPlugIn"> > <set-property property="pathnames" > value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" /> > </plug-in> > <plug-in className="org.apache.struts.tiles.TilesPlugin"> > <set-property property="definitions-config" > value="/WEB-INF/tiles-defs.xml" /> > </plug-in> > </struts-config> > -- > > validation.xml > -- > <form-validation> > <formset> > <form name="login"> > <field property="name" depends="required"> > <arg0 name="required" key="security.login.name"/> > </field> > <field property="password" depends="required"> > <arg0 name="required" key="security.login.password"/> > </field> > </form> > </formset> > </form-validation> > > > -- > Mark Mandel > Web Application Developer > Hitachi Data Systems Corporation > > --------------------------------------------------------------------- > 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]