Thanks to both you and Niall,

That was exactly it - I'd managed to get the two mixed up.

That makes life SO much easier :o)

Cheers,

Mark

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, 29 March 2004 5:26 PM
To: [EMAIL PROTECTED]
Subject: SV: Validator doesn't pick up any errors?

Hi

Looks like you should be using ValidatorForm - Not ValidatorActionForm

With ValidatorForm you name your formdefinitions in validation.xml the
same as the formnames in struts-config.xml
With ValidatorActionForm you name your formdefinitions validation.xml
the same as the action you are calling in struts-config.xml

This is a common mistake.

Hermod

-----Opprinnelig melding-----
Fra: Mark Mandel [mailto:[EMAIL PROTECTED]
Sendt: 29. mars 2004 09:02
Til: '[EMAIL PROTECTED]'
Emne: 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]


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that DnB NOR cannot
accept any payment orders or other legally binding correspondence with
customers as a part of an email. 

This email message has been virus checked by the virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


---------------------------------------------------------------------
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